Jump to content

Recommended Posts

Posted

As usual I hope I can explain myself...lol

Can someone help with a routine so I can place a dimension at 90deg from 2 clicked points AND have it offset 17" from the second clicked point?1554410901_Newimage.thumb.jpg.3b3f232412786f36238ff1ba238155eb.jpg

Posted (edited)

Have a look at this little bit of code it makes a dim and then moves the dim text. Its 120 in mm the mapcar is X Y Z offsets.

 

(command "dim" "VER" p1 pt1 pt3 "" "exit")
(setq obj (vlax-ename->vla-object (entlast)))
(setq tpos (mapcar '+ (vlax-get obj 'TextPosition) (list 125.0 120.0 0.0)))
(vlax-put obj 'TextPosition tpos)

 

Edited by BIGAL
Posted

hmmm,

Is there a way to set the angle of the dimension text?

Posted

After thinking about what I actually need to get done, this could be just text using the distance between the two clicks.

Then find the angle and turn the text 90deg and offsetting a distance from the second click?

Posted (edited)

Ok found it adding to what I posted earlier, need angle in radians. The offset point may need the values worked out like 1/2 dim length. Not tested.

 

(command "dim" "ver" p4 pt1 pt3 "" "exit")
(setq obj (vlax-ename->vla-object (entlast)))
(vla-put-textrotation obj (/ pi 2.))

image.thumb.png.e4317911e62c09594f7c39d16b2aecf1.png

Edited by BIGAL

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...