Thursday, September 27, 2012

Simple AutoLISP Code: Modified BREAK

I like to BREAK my line at the exact point I selected without typing much keywords, ie. by automated the "first point" option in the BREAK command, hence I came out with the following code:

(defun errBRF (message)
(command)
(setq *error* localErrorBRF)
(prompt "\nRoutine cancelled. ")
(princ)
)
(defun C:BRF (/ localErrorBRF brkPointBRF)
(setq localErrorBRF *error*)
(setq *error* errBRF)
(setq brkPointBRF (getpoint "\nPick break point: "))
(command "._BREAK" pause "F" brkPointBRF brkPointBRF)
(setq *error* localErrorBRF)
(princ)
)

A note though, this command prompts you to pick the desired break point prior to selecting an object, which is reversing the input sequence of the original BREAK command.

SketchUp Speed Modelling: A Simple Spiral Staircase [updated]

I supposed spiral staircase is one of the most popular subject in 3D modelling tutorials, however, for all the models I've done, spiral staircase is not in the list.


This is a simple spiral staircase -- with chequered plate treads welded to tees, which in turn are welded to a circular hollow section post. Balusters and railing are of circular hollow sections, too. I supposed the post should be mounted on a base plate that is bolted to a solid base.


The principle modelling process took less then 30 minutes to complete. The model of this staircase can be found in 3D Warehouse, as below.


>



Updates: I made an animation with this model, on this page.

Sunday, September 23, 2012

Simple AutoLISP Codes: Modified FILLET

In the drafting of beam elevations, I normally use FILLET to form the bend of rebar. While I prefer to simply leave the bend at a 90-degree angle -- which make the job easier for me, of course -- most prefer to have rounded edge where the rebar bends, ie. giving a radius value to the FILLET function.

I use FILLET extensively in any drafting session and when it comes to rebar bend with a radius, it's troublesome to set the radius of FILLET to different values time and again, so I wrote a few lines to create new FILLET commands that are mapped to the radius I desired.

The code below is a modified FILLET command -- completed with error-trapping function -- called F15, which is a FILLET command that has a 15-unit radius. The routine stores the existing FILLET radius value, substitutes it with 15 in the process and restores the existing value at the end.

(defun errF15 (message)
(command)
(setvar "filletrad" frad)
(setq *error* localErrorF15)
(prompt "\nRoutine cancelled. ")
(princ)

)
(C:F15 (/ localErrorF15 frad)
(setq localErrorF15 *error*)
(setq *error* errF15)
(setq frad (getvar "filletrad"))
(command "._FILLET" "R" "15" "._FILLET" pause pause)
(setvar "filletrad" frad)
(setq *error* localErrorF15)
(princ)

)

And yes, by replacing all the 15s in the code with 20s, you'll have a F20 command. ;-)
Related Posts Plugin for WordPress, Blogger...