danpp Posted April 27, 2016 Posted April 27, 2016 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 Quote
BIGAL Posted April 28, 2016 Posted April 28, 2016 (edited) 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 April 29, 2016 by BIGAL Version 2 recognises alignments Quote
Recommended Posts
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.