Jump to content

point on polyline


Nowak

Recommended Posts

Hello,
I'm looking for a Lisp which lets you know how long the point (or autocad block)
is in relation to the start of the polyline, each time that crosses it.

Edited by fuccaro
Just made the text more readable...
Link to comment
Share on other sites

This is a easy question to answer and rather than post code here is the functions to use so if you look at Visual lisp help for the vlax-curve functions it should become obvious,

(setq obj (vlax-ename->vla-object (car (entsel "Pick object "))))

(setq pt (getpoint "\nPick point for dist"))

(setq dist  (vlax-curve-getdistatpoint obj pt )) 

The pt is either a point picked on the pline or (setq ins (vlax-get obj 'insertionPoint)) for a block.

 

Make a start on learning lisp rather than just asking for answer.

 

Command: PL
PLINE
...............
Command: (setq obj (vlax-ename->vla-object (car (entsel "Pick object "))))
Pick object #<VLA-OBJECT IAcadLWPolyline 000001b9b823f128>
Command: (setq pt (getpoint "\nPick pline"))
(409.01 365.163 0.0)
Command: (setq dist  (vlax-curve-getdistatpoint obj pt ))
278.107

Lastly need a IF choice pick a block or point.

Edited by BIGAL
Link to comment
Share on other sites

Quote

I don't know the lisp

At the moment I write this, you have 10 posts and all are in the Lisp forum. If you have so much interest in it, you should make some effort to learn. Start from the basic things.

Link to comment
Share on other sites

2 hours ago, fuccaro said:

At the moment I write this, you have 10 posts and all are in the Lisp forum. If you have so much interest in it, you should make some effort to learn. Start from the basic things.

 

Already, I came here on this forum to create a BIM model on autocad, I lacked the programming to make the link between an Excel file and the 3D blocks, but hey, sorry to have disturbed you in my research.

Link to comment
Share on other sites

Keep asking questions you will get answers, in my prior post I posted an example you can copy and paste from here to Autocad command line do 1 line at a time and see what you get.

 

Afralisp has some good tutorials.

 

You get more help by having a go yourself.

 

I can see English is not first language. 

 

copy and paste each line


 

osmode 512

(setq obj (vlax-ename->vla-object (car (entsel "Pick pline "))))

(setq pt (getpoint "\nPick pline"))

(setq dist (vlax-curve-getdistatpoint obj pt ))

 

Look into help for the block using vla-get-insertionpoint

 

(setq obj (vlax-ename->vla-object (car (entsel "Pick block "))))
(setq pt (vla-get-insertionpoint obj)

BIM to excel 3d solids is very complex and not a 1st lisp project

 

 

 

 

 

 

 

Edited by BIGAL
Link to comment
Share on other sites

On 3/28/2020 at 11:34 PM, BIGAL said:

Keep asking questions you will get answers, in my prior post I posted an example you can copy and paste from here to Autocad command line do 1 line at a time and see what you get.

 

Afralisp has some good tutorials.

 

You get more help by having a go yourself.

 

I can see English is not first language. 

 

copy and paste each line


 


osmode 512

(setq obj (vlax-ename->vla-object (car (entsel "Pick pline "))))

(setq pt (getpoint "\nPick pline"))

(setq dist (vlax-curve-getdistatpoint obj pt ))

 

Look into help for the block using vla-get-insertionpoint

 


(setq obj (vlax-ename->vla-object (car (entsel "Pick block "))))
(setq pt (vla-get-insertionpoint obj)

BIM to excel 3d solids is very complex and not a 1st lisp project

 

 

 

 

 

 

 

I don't understand what to do with it?
Link to comment
Share on other sites

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