looking for a lisp to align civil 3d label to line

looking for a lisp to align civil 3d label to line

venturini.anthony
Advocate Advocate
311 Views
6 Replies
Message 1 of 7

looking for a lisp to align civil 3d label to line

venturini.anthony
Advocate
Advocate

looking to have a lisp that aligns all dragged selected civil 3d labels perpendicular to a line or polyline 

0 Likes
312 Views
6 Replies
Replies (6)
Message 2 of 7

Sea-Haven
Mentor
Mentor

Need a dwg to look at. You can get the angle of a point on a line or pline so add 90 degrees. What is the CIV3D label ?

This is the rotation part replace ang with correct 90 angle, then move label as well. use dumpit.lsp to find the other properties.

 

; Rotate a CIV3D point
; By Alan H March 2019

(defun AH:CIV3DPTROT ( / ang obj )

(setq ang (angle (getpoint "\nPick1st point")(getpoint "\nPick 2nd point") ))

(while (setq ent (entsel "Pick CIV3D points press ESC or pick nothing to exit"))
(setq obj (vlax-ename->vla-object (car ent))) 
(vlax-put-property obj 'Rotation ang )
)
)

(AH:CIV3DPTROT)

 

There is lots of realign text to object code out there just need to use the correct properties for the CIV3D Label say rather than Text which is normally in the code.

0 Likes
Message 3 of 7

john.uhden
Mentor
Mentor

Alan,

If you right-click on a label, isn't there a Reset option to return the label to its original location?

Sorry, but I am home without C3D.

John F. Uhden

0 Likes
Message 4 of 7

Sea-Haven
Mentor
Mentor

I erase a lot of junk dwgs including CIV3D examples need to know which label in case a different property required. I am still trying to master my degree in CIV3D when it comes to some of this complexity 🤣 .

0 Likes
Message 5 of 7

john.uhden
Mentor
Mentor

@Sea-Haven ,

Then there is my MatchLabelRotation.lsp which is around here somewhere.  Of course some of it can be found in the C3D help.  I guess they just confiscate our responses, but they do "own" the forum.

John F. Uhden

0 Likes
Message 6 of 7

hosneyalaa
Advisor
Advisor

Hi @venturini.anthony 

Can you attached example drawing

What is it Civil 3D version used

0 Likes
Message 7 of 7

Sea-Haven
Mentor
Mentor

Like you, message 2, "Need a dwg to look at"