OMEGA-ThundeR Posted March 22 Posted March 22 (edited) (setq DIAM 0.25) ;; Set diameter (used in previous part of code to place a circle/sweep) (setq CIRSWEEP (entlast)) ;; Set last created object (a SOLID cilinder (setq CHANGEHEIGHT (/ DIAM 2) ;; Set radius (half of DIAMeter -> <0.125>) (command "_.move" CIRSWEEP "" "_non" '(0 0 0) "_non" '(0 0 CHANGEHEIGHT)) ;; Move last created object in Z value Hi, based on above code it will not move the object. Probably the variable (CHANGEHEIGHT) in the coordinates on the move command. The value of DIAM isn't set so it could change. If there is a simpler way to move a 'ENTLAST' in z value i would like to hear. I tried the 'CHANGE' command to change Elevation, but that doesn't seem to work on solids for the lack of an 'elevation' property. Edited March 22 by OMEGA-ThundeR Quote
marko_ribar Posted March 22 Posted March 22 (edited) You need to close bracket before you comment line... (setq CHANGEHEIGHT (/ DIAM 2)) (setq DIAM 0.25) ;; Set diameter (used in previous part of code to place a circle/sweep) (setq CIRSWEEP (entlast)) ;; Set last created object (a SOLID cilinder (setq CHANGEHEIGHT (/ DIAM 2)) ;; Set radius (half of DIAMeter -> <0.125>) (command "_.move" CIRSWEEP "" "_non" '(0 0 0) "_non" '(0 0 CHANGEHEIGHT)) ;; Move last created object in Z value Edited March 22 by marko_ribar Quote
OMEGA-ThundeR Posted March 22 Author Posted March 22 Hmz.. that was an easy mistake. But i wonder if that would fix anything. Cause in my case it still doesn't move the object after correcting that error. But if i change the 'CHANGEHEIGHT' to a number, the object does move. Quote
marko_ribar Posted March 22 Posted March 22 (edited) You are using qouted lists that AutoCAD literarily read... Instead of this, you have to say to CAD that the lists in final line has to be evaluated... So, instead of this line : (command "_.move" CIRSWEEP "" "_non" '(0 0 0) "_non" '(0 0 CHANGEHEIGHT)) You should write it like this : (command "_.move" CIRSWEEP "" "_non" (list 0 0 0) "_non" (list 0 0 CHANGEHEIGHT)) That's all - it should work now as expected... Edited March 22 by marko_ribar 1 Quote
OMEGA-ThundeR Posted March 25 Author Posted March 25 On 3/22/2024 at 7:25 PM, marko_ribar said: You are using qouted lists that AutoCAD literarily read... Instead of this, you have to say to CAD that the lists in final line has to be evaluated... So, instead of this line : (command "_.move" CIRSWEEP "" "_non" '(0 0 0) "_non" '(0 0 CHANGEHEIGHT)) You should write it like this : (command "_.move" CIRSWEEP "" "_non" (list 0 0 0) "_non" (list 0 0 CHANGEHEIGHT)) That's all - it should work now as expected... Well, that LIST part worked like a charm (only did it on the part with the variable! Care to explain why 'list' does make it work? Perhaps i should read into this https://lee-mac.com/quote.html Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.