[Search tip detail and code files using keywords, tip number, author name, etc ]
 
Change Your UCS and Retain Subtracted Solids
Tip# 3316 By Greg Silva On 10-Jan-2010
2
Rated By 1 users
Categories : User Coordinate System
Software type : AutoCAD 2010
Rename File To : No Files to download.
The UCS routines make it easy to change your UCS with a few very quick keystrokes.

Greg Silva has sent us some simple routines to help out when working in 3D in AutoCAD.

"The following commands make it easy to switch among the most frequently used UCSs (user coordinate systems): front, world, left, and right."
 

   (defun c:ff ()

    (command "ucs" "front")

   )
 

   (defun c:ww ()

   (command "ucs" "world")

   )
 

   (defun c:ll ()

    (command "ucs" "left")

   )
 

   (defun c:rr ()

    (command "ucs" "right")

  )
 

"You usually don't want your coping boundaries to be deleted when you cope something. This program creates a copy of your boundary and uses it to subtract from your solid."

 

   (defun c:ss ()

    (princ "Select First Set:")

   (setq sel1 (ssget))

   (princ "Select Second Set:")

   (setq sel2 (ssget))

   (command "copy" sel2 "" "0,0" "")

   (command "subtract" sel1 "" sel2 "")

    )

Notes from Cadalyst Tip Patrol: These routines can all be placed in one LISP file and loaded when you want to use them, or you can create a separate file for each. The UCS routines make it easy to change your UCS with a few very quick keystrokes. The last routine is nice when using the subtraction command. Many times during 3D modeling, one solid is created, then a second is created and subtracted from the first. It is one way to create complex solids. This routine will perform the subtraction, but will retain the object that was taken away. (Normally, the subtracted object is deleted.) This could be very useful under certain circumstances. 

 

 

Average Rating:
2


User comments


Log In