Jump to content

LISP for Dimensioning from Multiple Points to Line


Recommended Posts

Posted

Here is a start for you, change the line to a dim command, next step is to pick all points and do in one go. Please have a go at modifying.

 

(setq oldsnap (getvar 'osmode))
(setq obj (vlax-ename->vla-object (car (entsel "\nPick line object"))))

(while
(setq pt (getpoint "pick point"))
(setq pt2 (vlax-curve-getClosestPointTo obj pt acextendnone))
(setvar 'osmode 0)
(command "line" pt pt2 "")
(setvar 'osmode oldsnap)
)

Posted

Hi BIGAL,

 

Thank you for your reply. However I have no background on LISP Programming.

I have tried my best to modify by changing the line to dim command as below. Still couldn't get it working though. Would you mind pointing out where went wrong?

(defun c:try2 ()



(setq oldsnap (getvar 'osmode))

(setq obj (vlax-ename->vla-object (car (entsel "\nPick line object"))))



(while

(setq pt (getpoint "pick point"))

(setq pt2 (vlax-curve-getClosestPointTo obj pt acextendnone))

(setvar 'osmode 0)

(command ".DIMLINEAR" pt pt2 "")

(setvar 'osmode oldsnap)

)

)

 

Posted

Very simple fix dim expects an offset point so

 

(command ".DIMLINEAR" pt pt2 pt )

  • 8 years later...
Posted

auto dimensioning by selecting multiple points and one line object

Posted
3 hours ago, Kumar1 said:

auto dimensioning by selecting multiple points and one line object

@Kumar1 please upload a sample.dwg with, at least, 2 o3 dim as you need it to be 

 

 

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...