Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

rotating point labels in 2013?

3 REPLIES 3
Reply
Message 1 of 4
kmdepfyffer
580 Views, 3 Replies

rotating point labels in 2013?

I was using this in 2011 to match label rotation of an existing point but it no longer works in 2013? does anyone know the value I need to grab and set or will this format not work in 2013,

 

(defun c:mro (/ doc ss ss2 obj obj2 newrot oldrot)
(vl-load-com)
(setq doc (vla-get-activedocument (vlax-get-acad-object))) (vla-startundomark doc)
(princ "\nSelect point to match the rotation of to: ")
(setq ss2 (ssget ":S" '((0 . "AECC_COGO_POINT"))))
(setq obj2 (vlax-ename->vla-object (ssname ss2 0)))
(setq newrot (vlax-get obj2 'Label_Rotation))
(princ "\n....select Points to change: ")
(if (setq ss (ssget '((0 . "AECC_COGO_POINT"))))
(while (> (sslength ss) 0) (setq obj (vlax-ename->vla-object (ssname ss 0))) (vl-catch-all-apply '(lambda () (vlax-put obj 'Label_Rotation newrot)
)
)
;;this will catch the error that occurs if the user selects a point with <default> or <none> as the style
(ssdel (ssname ss 0) ss)
)
)
(vla-endundomark doc)
(princ)
)

3 REPLIES 3
Message 2 of 4
kmdepfyffer
in reply to: kmdepfyffer

crap, that should say rotation not label_rotation

 

Message 3 of 4
Jeff_M
in reply to: kmdepfyffer

Use the Code button when composing messages to prevent the smiley's from becoming smileys.

 

(defun c:mro (/ doc ss ss2 obj obj2 newrot oldrot)
  (vl-load-com)
  (setq doc (vla-get-activedocument (vlax-get-acad-object)))
  (vla-startundomark doc)
  (princ "\nSelect point to match the rotation of to: ")
  (setq ss2 (ssget ":S" '((0 . "AECC_COGO_POINT"))))
  (setq obj2 (vlax-ename->vla-object (ssname ss2 0)))
  (setq newrot (vlax-get obj2 'LabelRotation))
  (princ "\n....select Points to change: ")
  (if (setq ss (ssget '((0 . "AECC_COGO_POINT"))))
    (while (> (sslength ss) 0)
      (setq obj (vlax-ename->vla-object (ssname ss 0)))
      (vl-catch-all-apply
	'(lambda ()
	   (vlax-put obj 'LabelRotation newrot)
	 )
      )
      ;;this will catch the error that occurs if the user selects a point with <default> or <none> as the style
      (ssdel (ssname ss 0) ss)
    )
  )
  (vla-endundomark doc)
  (princ)
)

 

Jeff_M, also a frequent Swamper
EESignature
Message 4 of 4
kmdepfyffer
in reply to: Jeff_M

lol thanks I swear I tried that.

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report