MikeP Posted May 23, 2011 Posted May 23, 2011 Here is what I have: (defun c:isol (/ ic) (initget 6) (if (setq ic (getdist "\nEnter Length: ")) (command "_.LINE" "" (* ic 0.816496581))) (princ)) Im trying to create a line command where it asks for a certain length and it draws the line. but what im having a problem with is, allowing me to click the base point of the line then selecting the proper angle then drawing the line to the reduced scale of the length I specified. Quote
Tharwat Posted May 23, 2011 Posted May 23, 2011 A very funny idea MikeP , I did really like it . Hope this would meet your needs . (defun c:test (/ p ang l p1) (if (setq p (getpoint "\n base point :")) (progn (while (setq Ang (getangle p "\n Next point for Angle :")) (setq l (getdist "\n Specify length :")) (entmakex (list (cons 0 "LINE") (cons 10 p) (cons 11 (setq p1 (polar p ang l))) ) ) (setq p p1) ) ) (princ) ) (princ) ) Tharwat Quote
MikeP Posted May 23, 2011 Author Posted May 23, 2011 Having problems. when I try to load it in the appload. it just says unknown command when I try to use it. I did change the shortcut in the command to something other than test. thanks. I use it to make isometric drawings. that is the scale if you were to go from a SW (or any 3d view) to a plan view. I have a dim style set up with a dim scale equal to that so I can dimension iso drawings. Quote
Tharwat Posted May 23, 2011 Posted May 23, 2011 Having problems. when I try to load it in the appload. it just says unknown command when I try to use it. I did change the shortcut in the command to something other than test. . No problem you can change the name of the routine as best as you want , and I also feel something going wrong in here while stepping through thread in the forum. Regards. Quote
CHLUCFENG Posted May 26, 2011 Posted May 26, 2011 Combine the two programs, then add in a check for the current dimscale... (defun c:isol (/ ic ds p ang p1) (setq ds (getvar "dimscale")) (if (setq p (getpoint "\nBase point :")) (progn (while (setq ang (getangle p "\nSelect Angle :")) (initget 6) (if (setq ic (getdist "\nEnter Length: ")) (entmakex (list (cons 0 "LINE") (cons 10 p) (cons 11 (setq p (polar p ang (* ic ds)))) ) ) ) ) ) ) (princ) ) :wink: Quote
Tharwat Posted May 26, 2011 Posted May 26, 2011 What's if the (getvar "dimscale") is equal to zero ? Regards. Quote
BlackBox Posted May 26, 2011 Posted May 26, 2011 Out of curiosity... why are you not drawing your line work at 1:1 (true scale) in Model Space, and using Paper Space Viewports to handle your scaling? Quote
CHLUCFENG Posted May 26, 2011 Posted May 26, 2011 What's if the (getvar "dimscale") is equal to zero ? Regards. ummm... I have a dim style set up with a dim scale equal to that so I can dimension iso drawings. I didn't think that would be an issue. But, error trapping could check that, and prompt the user if necessary. Quote
MikeP Posted June 2, 2011 Author Posted June 2, 2011 both these programs submitted are not using the scale 0.816496581. I want to enter a length, and it draws a line scaled to my number at the selected angle. Quote
CHLUCFENG Posted June 2, 2011 Posted June 2, 2011 Will this work? (defun c:isol (/ ic ds p ang p1) (setq ds [color=red]0.816496581[/color]) (if (setq p (getpoint "\nBase point :")) (progn (while (setq ang (getangle p "\nSelect Angle :")) (initget 6) (if (setq ic (getdist "\nEnter Length: ")) (entmakex (list (cons 0 "LINE") (cons 10 p) (cons 11 (setq p (polar p ang (* ic ds)))) ) ) ) ) ) ) (princ) ) Then, the ds variable can be changed to whatever you like. 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.