Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

process_solutions
en respuesta a: TheCADnoob

(Defun C:SET_DXF_ORIGIN ()

(setvar "treedepth" (getvar "treedepth"))
(COMMAND "ZOOM" "EXTENTS" "REGEN")
(setvar "treedepth" (getvar "treedepth"))

(setvar "INSBASE" (Getvar "Extmin"))

(princ)

)

 

 

Run the above to set the insertion base of the dwg to the lowest left point, or literally type

INSBASE

0,0,0

 

IF 0,0 is exactly where the origin should be, but if the data is not already located with the extmin at 0,0 it may be necessary to move the data to 0,0... I use the following regularly:

 

(defun c:Relocate_to_Origin ( / osmodewas)
(setq osmodewas (getvar "OSMODE"))
(setvar "osmode" 0)
(setvar "VTENABLE" 7)
(setvar "treedepth" (getvar "treedepth"))
(command "zoom" "extents" "REGEN")
(setvar "treedepth" (getvar "treedepth"))
(command "-layer" "unlock" "*" "" "move" "all" "" (getvar "extmin") "0,0")
(setvar "treedepth" (getvar "treedepth"))
(command "zoom" "extents")
(setvar "treedepth" (getvar "treedepth"))
(setvar "osmode" osmodewas)
(setvar "VTENABLE" 3)
(princ)
)

 

Hope these ideas help.

 

Regards,

Sean