Need some help with Dimlinear in Lisp

Need some help with Dimlinear in Lisp

annoisscary
Advocate Advocate
563 Views
6 Replies
Message 1 of 7

Need some help with Dimlinear in Lisp

annoisscary
Advocate
Advocate

So I am trying to add Dimensions to an existing routine and figured it should be pretty simple given I already have all the points needed to do so. Well, I have everything dimensioned correctly regarding the points but I cant figure out how to get a consistent placement on the dimensions. I ended up making multiple defuns for different sections of the door with different placements to make them line up, but noticed it isn't really a one size fits all. I'm guessing it has something to do with the size of the text related to the dimension? 

 

At any rate, all I want is to be able to place everything on the same "line". In the sample picture there is a yellow rectangle, that is where I would like everything to be placed regardless of orientation. Any help is appreciated!

 

annoisscary_0-1665672658299.png

 

Here's the simple dimensioning function I'm using atm

  (defun dimedgelrf (pt1 pt2)
    (command "_.dimlinear" pt1 pt2 "V" "-10.9375"
    )
  )
0 Likes
Accepted solutions (1)
564 Views
6 Replies
Replies (6)
Message 2 of 7

Kent1Cooper
Consultant
Consultant
Accepted solution

@annoisscary wrote:

....

Here's the simple dimensioning function I'm using atm

  (defun dimedgelrf (pt1 pt2)
    (command "_.dimlinear" pt1 pt2 "V" "-10.9375"
    )
  )

What's the -10.9375?  That comes where it's asking for the dimension-line location.  I have a feeling that as just a number [not a point], that will give you different results depending on where the cursor happens to be, taking the number as the distance from the last point in the direction toward the current cursor location.

 

Would something like this be better, for [I'm assuming] Dimensions along the left edge?

(command "_.dimlinear" pt1 pt2 "V" "@-10.9375,0")

Kent Cooper, AIA
0 Likes
Message 3 of 7

annoisscary
Advocate
Advocate

If nothing else that's certainly a better solution. How would I specify a point in X for the lines to end up on? I think that would be better because then I could account for any parts changing size by just adding my offset to the outside point. 

 

as in, I want all dim lines on the right side to lineup with pt3 (bottom right of door) +2 inches

0 Likes
Message 4 of 7

Kent1Cooper
Consultant
Consultant

@annoisscary wrote:

....

as in, I want all dim lines on the right side to lineup with pt3 (bottom right of door) +2 inches


Try something like this [untested]:

 

(command "_.dimlinear" pt1 pt2 "V" (polar pt3 0 2))

Kent Cooper, AIA
0 Likes
Message 5 of 7

annoisscary
Advocate
Advocate

Nevermind, I got it! Thanks for the help, don't know why I didn't just tell it to put them on a point.

 

  (defun dimedgelrf (pt1 pt2)
  (setq dpt3 (Mapcar '+ pt3 (list 2 0.0 0.0)))
    (command "_.dimlinear" pt1 pt2 "v" dpt3
    )
  )

 

0 Likes
Message 6 of 7

Kent1Cooper
Consultant
Consultant

You might want to add a "_none" Osnap call before either my (polar) entry or your dpt3.

Kent Cooper, AIA
0 Likes
Message 7 of 7

annoisscary
Advocate
Advocate

Its already set to off at the point in the overall routine when it starts dimensioning, Thanks again!

0 Likes