Jump to content

Help required on making block attributes in readable angles


Recommended Posts

Posted

Hi Friends, 

         Help required on making the font to readable angles,  i have created a block with Annotative, so it always in 0 degree, but now i need it to be in Most readable angle inside the blocks , wherever i insert it in drawing & rotates it.

could someone help me to resolve it.

attached screenshot & sample drawing of my requirements.

image.thumb.png.62476dceb4fb07dcd304cf183397ccba.png

sample.dwg

Posted (edited)

I found this in AutoDesk HELP (F-1) by searching "USE A FIELD TO SHOW ANGLE IN A BLOCK".  If you get into trouble, steven-g may come in to help.  He is a member here.

 

Good luck

 

Dynamic Block - Display Rotation Bearing

2019-09-16
Accepted Solutions In Forums
Byluke_anthony906

Dynamic Block Query - is there a way to create a dynamic degree bearing number that changes when rotating a dynamic block?

I know how to use the rotate parameters within a dynamic block but would love it to display the angle when using the block and of course for the number to change as the rotation angle does. 

luke_anthony906
2019-09-16

It is easiest inside the block editor. Add an attribute to the block and when you get to the 'attribute default'.

In the field dialogue select block placeholder and then select the rotation parameter,

click OK and exit the block editor. Run attsync choosing the block, and then change the rotation and run regen.

Screenshot (238).png

 

Screenshot (239).png

steven-g

Remember, you must run regen (or SAVE) to get the field to update.

 

 

Edited by Dana W
Posted

Hi Dana W, 

                Thanks for looking on this Thread,  

Actually i want the Text inside that Block to be Rotated as per the block angle, i can able to that by applying rotational action inside Dynamic block, 

but in some angles Text in getting into inverted position, i need that to be kept in Most readable angle, please check the below screenshot.

image.thumb.png.819a18b3089bffe6daf9380f9218d159.png

 

 

i tried with the above provided solution but it just places the angle of the Block in the place of a text.

Could you please help me resolve it.

 

Posted (edited)

Quickly written:

(defun c:fixatt ( / i s )
    (if (setq s (ssget "_:L" '((0 . "INSERT") (66 . 1))))
        (repeat (setq i (sslength s))
            (foreach  a (vlax-invoke (vlax-ename->vla-object (ssname s (setq i (1- i)))) 'getattributes)
                (if (and (vlax-write-enabled-p a) (= :vlax-false (vla-get-invisible a)))
                    (vla-put-rotation a (LM:readable (vla-get-rotation a)))
                )
            )
        )
    )
    (princ)
)

;; Readable  -  Lee Mac
;; Returns an angle corrected for text readability.

(defun LM:readable ( a )
    (   (lambda ( a )
            (if (and (< (* pi 0.5) a) (<= a (* pi 1.5)))
                (LM:readable (+ a pi))
                a
            )
        )
        (rem (+ a pi pi) (+ pi pi))
    )
)

(vl-load-com) (princ)

 

Edited by Lee Mac
  • Thanks 1
Posted
1 hour ago, Lee Mac said:

Quickly written:


(defun c:fixatt ( / i s )
    (if (setq s (ssget "_:L" '((0 . "INSERT") (66 . 1))))
        (repeat (setq i (sslength s))
            (foreach  a (vlax-invoke (vlax-ename->vla-object (ssname s (setq i (1- i)))) 'getattributes)
                (if (and (vlax-write-enabled-p a) (= :vlax-false (vla-get-invisible a)))
                    (vla-put-rotation a (LM:readable (vla-get-rotation a)))
                )
            )
        )
    )
    (princ)
)

;; Readable  -  Lee Mac
;; Returns an angle corrected for text readability.

(defun LM:readable ( a )
    (   (lambda ( a )
            (if (and (< (* pi 0.5) a) (<= a (* pi 1.5)))
                (LM:readable (+ a pi))
                a
            )
        )
        (rem (+ a pi pi) (+ pi pi))
    )
)

(vl-load-com) (princ)

 

 

Thank you so much Sir, i worked like a charm :)

Thank you so much for all the special things you do Sir.

Posted
23 hours ago, amb2301 said:

Hi Dana W, 

                Thanks for looking on this Thread,  

Actually i want the Text inside that Block to be Rotated as per the block angle, i can able to that by applying rotational action inside Dynamic block, 

but in some angles Text in getting into inverted position, i need that to be kept in Most readable angle, please check the below screenshot.

image.thumb.png.819a18b3089bffe6daf9380f9218d159.png

 

 

i tried with the above provided solution but it just places the angle of the Block in the place of a text.

Could you please help me resolve it.

 

OK, I thought you needed the "font" (text) to show the angle of the block, since the text attribute already stays at the most readable angle (parallel with the reader) in the block.

  • 2 months later...
Posted

hi,

Thanks for looking on this Thread

I looking for different block attribute text width is different I want to make them right (from 0.65 to 0.80)

Is there is any way to do that quickly instead of picking one by one

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...