ILoveMadoka Posted 2 hours ago Posted 2 hours ago (edited) Here is what I am trying to do. Draw a TRIM - FENCE from these two points to cut the vertical lines Here is my code (setq pt1 "0.5,1.0,0.0") (setq pt2 "3.0,1.0,0.0") (command "trim" "fence" pt1 pt2) If I execute this code, I get this (the lines are not trimmed) If I manually type TRIM - FENCE - !PT1 - !PT2 I get this (it works, I have to press enter to finish) What am I missing in getting this code/command to work the way I want? Edited 2 hours ago by ILoveMadoka Quote
BlackBox Posted 1 hour ago Posted 1 hour ago (edited) (defun c:FOO (/ pt1 pt2) (if (and (setq pt1 (getpoint "\nSpecify first point: ")) (setq pt2 (getpoint pt1 "\nSpecify second point: ")) ) (command-s "._trim" "_o" "_s" "" "_f" pt1 pt2 "" "") ) (princ) ) Edited 59 minutes ago by BlackBox 1 Quote
mhupp Posted 1 hour ago Posted 1 hour ago (edited) I know that's how command line works (typing in points), but you have to pass it a list. so either use getpoint or use the following to hard code x y z. (setq pt2 '(0.5 1.0 0.0)) or (setq pt2 (list 0.5 1.0 0.0)) Asks user to set points with getpoint. used the first point so you can see the fence. defaults do your point if nothing is picked. (setq pt1 (getpoint "\nPick Point<0.5, 1.0, 0.0>: ")) (if (= pt1 "")(setq pt2 '(0.5 1.0 0.0))) (setq pt2 (getpoint pt1 "\nPick Point<0.5, 1.0, 0.0>: ")) (if (= pt2 "")(setq pt2 '(3.0 1.0 0.0))) ; '(makes it a list -edit using @BlackBox Command-s means it wont run the command unless both points are defined. good for error handling Edited 1 hour ago by mhupp 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.