Author Topic: How to keep attributes always at 0 rotation  (Read 4871 times)

0 Members and 1 Guest are viewing this topic.

T-Square

  • Guest
How to keep attributes always at 0 rotation
« 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.

ronjonp

  • Needs a day job
  • Posts: 7526
Re: How to keep attributes always at 0 rotation
« Reply #1 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)
)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Kate M

  • Guest
Re: How to keep attributes always at 0 rotation
« Reply #2 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.

T-Square

  • Guest
Re: How to keep attributes always at 0 rotation
« Reply #3 on: September 02, 2008, 02:43:52 PM »
Kate,

Thanks. I think I have it.

See attached.

Comments? Suggestions?

Have an Awesome Day!

T-Square

  • Guest
Re: How to keep attributes always at 0 rotation
« Reply #4 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!

Kate M

  • Guest
Re: How to keep attributes always at 0 rotation
« Reply #5 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.

T-Square

  • Guest
Re: How to keep attributes always at 0 rotation
« Reply #6 on: September 02, 2008, 05:31:04 PM »
Thanks again Kate.  :kewl:

Have an Awesome Day!