- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Pretty much a newby to AutoLISP, I have workd in several other languages, I think this is just a syntax issue but I cant seem to find the solution.
Object: a simple LISP routin that rund from inside blockeditor, it moves all enities within the block to be centered on 0,0,0 by doing that when it is finished the block insertation point will be the center of the bolck.
here is my routine
(defun C:Myprog()
(command "_zoom" "extents")
(setq p1 (getvar "VIEWCTR"))
(setq ss1 (ssget "X"))
(command "_move" !ss1 "" !p1 "@0,0,0")
(princ)
)
When I run the commands interactivly here is what I get
Command: (command "_zoom" "extents")
_zoom
Specify corner of window, enter a scale factor (nX or nXP), or
[All/Center/Dynamic/Extents/Previous/Scale/Window/Object] <real time>: extents
Command: nil
Command: (setq p1 (getvar "VIEWCTR"))
(4.55988 6.96857 0.0)
Command: (setq ss1 (ssget "X"))
<Selection set: 228>
Command: (command "_move" !ss1 "" !p1 "@0,0,0")
_move
Select objects:
Command: @@0,0,0 Unknown command "@0,0,0". Press F1 for help
Command: nil
The problem seems to be with entering "@0,0,0" and the final destination point of the move, I have tried several different variation but cant seem to find the correct syntax for enterint that point into the move command.
Solved! Go to Solution.