Author Topic: Dimension placement  (Read 328 times)

0 Members and 1 Guest are viewing this topic.

jrr114

  • Mosquito
  • Posts: 13
Dimension placement
« on: October 07, 2021, 01:39:52 PM »
Is there a LISP to toggle placement of dimension text with leader?  I would like to place text in a different quadrant about the dimension line and extension lines.

BIGAL

  • Swamp Rat
  • Posts: 849
  • 30 + years of using Autocad
Re: Dimension placement
« Reply #1 on: October 07, 2021, 08:58:39 PM »
Yes you can make the dim then alter its position. Hopefully this makes sense. There is lots of code wrapped around this.

Code: [Select]
(command "dim" "hor" pt1 p4 pt3 "" "exit")
(setq obj (vlax-ename->vla-object (entlast)))
(setq tpos (mapcar '+ (vlax-get obj 'TextPosition) (list 90 -18 0.0))) ; change list X Y Z of point
(vlax-put obj 'TextMovement 1)
(vlax-put obj 'TextPosition tpos)
[code]
A man who never made a mistake never made anything

MSTG007

  • Gator
  • Posts: 2534
  • I can't remeber what I already asked! I need help!
Re: Dimension placement
« Reply #2 on: October 08, 2021, 07:16:18 AM »
Thats pretty slick.
Civil3D 2020

BIGAL

  • Swamp Rat
  • Posts: 849
  • 30 + years of using Autocad
Re: Dimension placement
« Reply #3 on: October 08, 2021, 07:19:23 PM »
Thanks, just used dumpit and entget to look at what variables were changing. Had to do exactly what was asked for.
A man who never made a mistake never made anything

jrr114

  • Mosquito
  • Posts: 13
Re: Dimension placement
« Reply #4 on: October 12, 2021, 10:11:08 AM »
Thanks BigAl.  You LISP writers are amazing.  What should I be typing in the command line?  Sorry to be so dumb.  I tried typing DIM and that didn't work.

MSTG007

  • Gator
  • Posts: 2534
  • I can't remeber what I already asked! I need help!
Re: Dimension placement
« Reply #5 on: October 12, 2021, 11:37:06 AM »
Something Like this...

Code: [Select]
(defun C:DR () ;;Dim Right
(command "dim" "hor" pt1 p4 pt3 "" "exit")
(setq obj (vlax-ename->vla-object (entlast)))
(setq tpos (mapcar '+ (vlax-get obj 'TextPosition) (list 90 -18 0.0))) ; change list X Y Z of point
(vlax-put obj 'TextMovement 1)
(vlax-put obj 'TextPosition tpos)
(princ)
)
Civil3D 2020

BIGAL

  • Swamp Rat
  • Posts: 849
  • 30 + years of using Autocad
Re: Dimension placement
« Reply #6 on: October 12, 2021, 11:29:47 PM »
Think of it more like this

(command "dim" "hor" pt1 pt2 pt3 "" "exit")

pt1 is left pick point
pt2 is right pick point
pt3 is dim line pick point
all are calulated in some way or picked

(list 90 -18 0.0)) move the point +90 in X direction -18 in Y direction Z no change

You could do a after making dim make a choice, LL UL UR LR for the 4 directions. For me I use a library program that makes a dcl on the fly.



« Last Edit: October 12, 2021, 11:35:59 PM by BIGAL »
A man who never made a mistake never made anything