TheSwamp

CAD Forums => CAD General => Dynamic Blocks => Topic started by: T-Square on September 01, 2008, 05:37:02 PM

Title: How to keep attributes always at 0 rotation
Post 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.
Title: Re: How to keep attributes always at 0 rotation
Post by: ronjonp on September 02, 2008, 11:25:50 AM
I'm not sure that can be done with the dynamic block. You could use this to quickly put all atts at 0 rotation:

Code: [Select]
(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)
)
Title: Re: How to keep attributes always at 0 rotation
Post by: Kate M on September 02, 2008, 01:22:03 PM
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.
Title: Re: How to keep attributes always at 0 rotation
Post by: T-Square on September 02, 2008, 02:43:52 PM
Kate,

Thanks. I think I have it.

See attached.

Comments? Suggestions?

Have an Awesome Day!
Title: Re: How to keep attributes always at 0 rotation
Post by: T-Square on September 02, 2008, 02:47:14 PM
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!
Title: Re: How to keep attributes always at 0 rotation
Post by: Kate M on September 02, 2008, 02:54:33 PM
Comments? Suggestions?
Yep, looks just like the way I've done it in the past. Glad it worked out.
Title: Re: How to keep attributes always at 0 rotation
Post by: T-Square on September 02, 2008, 05:31:04 PM
Thanks again Kate.  :kewl:

Have an Awesome Day!