×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

placing dimensions using AutoLISP

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?

RE: placing dimensions using AutoLISP

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.

RE: placing dimensions using AutoLISP

(OP)
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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources