placing dimensions using AutoLISP
placing dimensions using AutoLISP
(OP)
Ok, I am trying to place some linear dimensions in my lisp program, and everything works fine until it has to set the dimension position. My code looks like this:
(setvar "CLAYER" "T")
(command "DIMSTYLE" "R" "standard")
(setvar "DIMDEC" 3)
(setvar "DIMATFIT" 3)
(setvar "DIMUPT" 1)
(setvar "DIMTIX" 1)
(command "dimlinear" pt8 pt10 "V" (polar (polar pt14 UP 0.75) RT 1.25))
The dimension shows up on screen waiting for the text location, which I thought I specified. Is there some other system variable I need to change for this to work, or is one of the ones I have set messing me up?
(setvar "CLAYER" "T")
(command "DIMSTYLE" "R" "standard")
(setvar "DIMDEC" 3)
(setvar "DIMATFIT" 3)
(setvar "DIMUPT" 1)
(setvar "DIMTIX" 1)
(command "dimlinear" pt8 pt10 "V" (polar (polar pt14 UP 0.75) RT 1.25))
The dimension shows up on screen waiting for the text location, which I thought I specified. Is there some other system variable I need to change for this to work, or is one of the ones I have set messing me up?





RE: placing dimensions using AutoLISP
I am not sure if placing the "polar" function in a command line can work, it is just something I have never noticed or tried. Below is what I used that worked for me but of course the "ver" may also at times need to change at times to "hor".
(defun C:test (/)
(setq PT1 (getpoint "\nPoint 1")
PT2 (getpoint "\nPoint 2")
PT3 (getpoint "\nPoint 3")
PT4 (polar pt3 0 1.25)
)
(command "dimlinear" PT1 PT2 "ver" PT4)
)
I did not have to change any variables to get this to work.
Good luck.
RE: placing dimensions using AutoLISP
(setq UP (DTR 90))
(setq DN (DTR 270))
(Setq RT (DTR 0))
(setq LT (DTR 180))
;sets direction variables
(command "dimlinear" pt8 pt10 "V" (polar (polar pt14 UP 0.70) RT 1.25))
Thanks for the help.