Jump to content

Reference a block to road alignment


danpp

Recommended Posts

Basically I want to reference those traffic/road signs to the aligment.

 

If I lookup for block A1 (which references to a traffic sign) I want to know which station (e.g. 33+660);

 

PS.: I use dynamic blocks

 

I tried to do that manually, exporting data both from the alignment and traffic signs to excel. But sometimes the X,Y coordinates don't match exactly because the signs are not ATTACHED to the stations.

 

Any help or ideas on that would be welcome!

 

Cheers

Capturar.jpg

Link to comment
Share on other sites

Using the VL closest point to would work out the sq off the alignment point then you can use vl get distance at point , will try to find some example code.

 

Here is a short bit that is the heart of a bigger code, pick a pt pick a pline returns the answers

 

(defun c:choff ( / pt obj newpt len len2) 
(setq pt (getpoint "Pick point"))
(setq obj (vlax-ename->vla-object (car (entsel "Pick pline or Alignment"))))
(setq newPt (vlax-curve-getClosestPointTo Obj Pt))
(setq len (vlax-curve-getdistatpoint obj newpt))
(if (= "AeccDbAlignment" (vla-get-ObjectName obj))
(setq len (+ len (vlax-get-property obj 'startingstation)))
)
(setq len2 (distance newpt pt))
(alert (strcat "The ch is " (rtos len 2 3) "\n\nOffset is " (rtos len2 2 3)))
)

Edited by BIGAL
Version 2 recognises alignments
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...