Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

placing dimensions using AutoLISP

Status
Not open for further replies.

Nate242

Mechanical
Feb 14, 2005
25
0
0
US
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?
 
Replies continue below

Recommended for you

I have tried to reproduce your command line to work with no success. When I remove the "polor" function from the command line and placed it up into my "setq" area, the dimensions line gets placed.

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.
 
I narrowed it down to the RT, UP, etc.. variables, I hadn't defined them. I was referencing some other code that used them, and I thought it might be part of the syntax, I guess not. I defined them as such and rewrote the code with success.

(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.
 
Status
Not open for further replies.
Back
Top