VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Rotate a line and update angular dimension

2 REPLIES 2
Reply
Message 1 of 3
charley.rocha
1267 Views, 2 Replies

Rotate a line and update angular dimension

Hello everyone, please consider the picture below:

 

Screenshot_5.png

I need to rotate the yellow arrows and have the angular dimensions to follow them programmatically.

 

Before starting to write the macro, I tried this manually, and just by rotating the arrows alongside the circle, the dimensions followed them automatically, updating their measurements.

 

Then I wrote my macro based on that premise, but the angular dimensions didn't stretch out to follow the arrows.

 

So I thought if I rotated both the arrow and the angular dimension together it might work (it does work when done manually). But I don't know how to rotate the two entities at once (the arrow is a block and the dimension is a regular AcadDimAngular).

 

I need some ideas on how to get this to work. Any guess?

Tags (3)
Labels (3)
2 REPLIES 2
Message 2 of 3

I believe what you are looking for is similar to the lisp code from (will need a little tweaking, but the idea is there)

 

https://autocadtips1.com/2014/02/01/autolisp-rotate-multiple-objects-around-their-base-point/

 

Make sure both the arrow block and dim line are in the selection set.

Message 3 of 3
leeminardi
in reply to: charley.rocha

If you assign a group name to one of the yellow arrows you have a couple of options.

 

The following vlisp statement will rotate the line 10° and update the angular dimension (assuming the yellow line was referenced when adding the dimension).   P1 was previously assigned to the center of the circle and g1 the name of the group for the line.

(command "_rotate" "g" "g1" "" p1 10 "")

If you know the location of the center and do not want to set a vlisp variable for the point you could use something like:

(command "_rotate" "g" "g1" "" "1.1,2.2" 10 "")

where 1.1,2.2 is the center of the circle.

 

lee.minardi

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report