TheSwamp
CAD Forums => CAD General => Dynamic Blocks => Topic started by: T-Square on September 01, 2008, 05:37:02 PM
-
Hello,
Is there a way to keep an attribute at a 0 rotation no matter what the block rotation is?
The attached db is an interior 4 direction elevation marker. Only the exterior attributes need this always at 0 rotation.
I would like to use this on some of my other blocks as well.
Also, how does one keep all attributes, line work, etc. visible when you step out of the db editor into the main graphics screen?
Any help is appreciated.
-
I'm not sure that can be done with the dynamic block. You could use this to quickly put all atts at 0 rotation:
(defun c:atts0 (/ ss blk att)
(if (setq ss (ssget '((0 . "INSERT") (66 . 1))))
(foreach blk (mapcar 'vlax-ename->vla-object
(vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
)
(foreach att (vlax-invoke blk 'getattributes)
(vla-put-rotation att 0.)
(vla-update att)
)
)
)
(princ)
)
-
Welcome to chained parameters. :-)
Define a point parameter with chained actions & no grips. Associate a move action with that parameter & select the attribute. Define your rotation action as normal, but include the point parameter (NOT the attribute) in its selection set.
If you get stuck, post your block.
-
Kate,
Thanks. I think I have it.
See attached.
Comments? Suggestions?
Have an Awesome Day!
-
Ron Jon,
If I convert my current block set to db's with this type of rotation stabilizing magic, then I won't have to use the code you have shown me, they will auto rotate. The code you have shown me is the basically the same code I am using now to rotate att's to 0 once I have completed the mission of placing all of the blocks.
Yet another way to skin the cat.
Thanks. Have an Awesome Day!
-
Comments? Suggestions?
Yep, looks just like the way I've done it in the past. Glad it worked out.
-
Thanks again Kate. :kewl:
Have an Awesome Day!