AutoCAD Command to reset Block Rotation angle to zero

AutoCAD Command to reset Block Rotation angle to zero

Anonymous
Not applicable
8,922 Views
7 Replies
Message 1 of 8

AutoCAD Command to reset Block Rotation angle to zero

Anonymous
Not applicable

Hi All,

 

Please let me know AutoCAD command to reset the block rotation angle to zero.

0 Likes
Accepted solutions (1)
8,923 Views
7 Replies
Replies (7)
Message 2 of 8

john.p.addy
Collaborator
Collaborator

Is the block actually rotated at the 45 degree?

Thank you,
John Addy
Electrical Engineering Tech.
Department of Defense
0 Likes
Message 3 of 8

Anonymous
Not applicable

Thank you for your reply Sir,

 

Yes, Block has been rotate at 45 Degree.

 

Basically i am defining a AutoCAD script, where the block to rotate at specified angle and plot the window selection area, then again to reset the block rotation angle to zero for rotate to next angle value and plot.

 

Thank you..

 

Regards,

Harish

0 Likes
Message 4 of 8

tramber
Advisor
Advisor

Change the value by clicking in that field with your mouse Smiley Wink


EESignature

0 Likes
Message 5 of 8

tramber
Advisor
Advisor
Accepted solution

You can also use the CHANGE command on a block insertion to redifine the angle but it would mean that you select, wich is quite some art in scripts.


EESignature

0 Likes
Message 6 of 8

john.p.addy
Collaborator
Collaborator

The only thing I can think of is to go into the actual block and rotate the block -45 degrees, or rotate the block -45 degrees

Thank you,
John Addy
Electrical Engineering Tech.
Department of Defense
0 Likes
Message 7 of 8

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

.... the block to rotate at specified angle and plot the window selection area, then again to reset the block rotation angle to zero for rotate to next angle value and plot.

....


You could simply do something like this:

 

Rotate the North Arrow

Plot {whatever that involves}

U ; [undo the Plot, which won't have any effect in the drawing]

U ; [undo the Rotate command]

Rotate the North Arrow for the next....

 

If that isn't viable for some reason, and if you have full AutoCAD and therefore AutoLisp capability, and if there is only one such Block in the drawing, you can just force it to be at 0 rotation:

(vl-load-com); if necessary

(vla-put-rotation (vlax-ename->vla-object (ssname (ssget "_X" '((2 . "NorthArrow"))) 0)) 0)

Kent Cooper, AIA
0 Likes
Message 8 of 8

leeminardi
Mentor
Mentor

The following vlisp code uses the ALIGN command to  reorient a 3D block so that its axes are parallel to the WCS.  It "unrotates" the block.

 

(defun c:unrot (/ bdata bm xv yv pos spt2 tpt2 spt3 tpt3)
; rotates a block so that its axes
; are aligned to the WCS
; L. Minardi  2/20/2018  
  (setq bdata (nentsel))
  (setq bm (nth 2 bdata))
  (setq	xv  (nth 0 bm)
	yv  (nth 1 bm)
	pos (nth 3 bm)
  )
  (setq	spt2 (mapcar '+ pos xv)
	tpt2 (mapcar '+ pos '(1 0 0))
	spt3 (mapcar '+ pos yv)
	tpt3 (mapcar '+ pos '(0 1 0))
  )
  (command "align" pos "" pos pos spt2 tpt2 spt3 tpt3)
  (princ)
)

 

lee.minardi
0 Likes