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

change dimension style properties

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
155 Views, 3 Replies

change dimension style properties

I am searching the whole drawing for everything and would like to change all
dimension style arrows to acArrowOpen30 if not already.

Why does this not work. I am going home now and eagerly await your answer
tomorrow.

Dim sset As AcadSelectionSet
Set sset = ThisDrawing.SelectionSets.Add("All_Objs")
sset.Select acSelectionSetAll
If Err Then
Err.Clear
sset.Select acSelectionSetAll
End If
Dim OBJ As AcadEntity
For Each OBJ In sset
OBJ.Color = acByLayer

If OBJ.ObjectName = AcadDimAligned Then
OBJ.Arrowhead1Type = acArrowOpen30
OBJ.Arrowhead2Type = acArrowOpen30
ThisDrawing.Regen acAllViewports
End If



TIA
--
Eric Stewart
Design Development

-- reverse order for direct email
liame tcerid rof redro esrever--
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: Anonymous

Arrowhead1Block


"Eric Stewart" wrote in message
news:A5864436C20AC4075EA97B91E4A5374C@in.WebX.maYIadrTaRb...
> I am searching the whole drawing for everything and would like to change
all
> dimension style arrows to acArrowOpen30 if not already.
>
> Why does this not work. I am going home now and eagerly await your
answer
> tomorrow.
>
> Dim sset As AcadSelectionSet
> Set sset = ThisDrawing.SelectionSets.Add("All_Objs")
> sset.Select acSelectionSetAll
> If Err Then
> Err.Clear
> sset.Select acSelectionSetAll
> End If
> Dim OBJ As AcadEntity
> For Each OBJ In sset
> OBJ.Color = acByLayer
>
> If OBJ.ObjectName = AcadDimAligned Then
> OBJ.Arrowhead1Type = acArrowOpen30
> OBJ.Arrowhead2Type = acArrowOpen30
> ThisDrawing.Regen acAllViewports
> End If
>
>
>
> TIA
> --
> Eric Stewart
> Design Development
>
> -- reverse order for direct email
> liame tcerid rof redro esrever--
>
>
Message 3 of 4
Anonymous
in reply to: Anonymous

That did not work.

The example from the help file works. It creates an angular dimension and
then changes it. I think the reason my code does not work may have somethng
to do with trying to extract a dimension object from the selection set.

What do you think?

TIA


"Joe Melton" wrote in message
news:0DA135C5C5047647719E6EF9FE66E479@in.WebX.maYIadrTaRb...
> Arrowhead1Block
>
>
Message 4 of 4
Anonymous
in reply to: Anonymous

I know the ObjectNames of different dimensions. However, when I use that in
my code, still nothing changes. This is driving me crazy.

To find the name I did this

Dim OBJ As AcadEntity
ThisDrawing.Utility.GetEntity OBJ, IPT, "pICK AN OBJECT"
MsgBox (OBJ.ObjectName)

and here is my code attempting to change settings

Dim sset As AcadSelectionSet
Set sset = ThisDrawing.SelectionSets.Add("All_Objs")
sset.Select acSelectionSetAll
If Err Then
Err.Clear
sset.Select acSelectionSetAll
End If
Dim OBJ As AcadEntity
For Each OBJ In sset
OBJ.Color = acByLayer

If OBJ.ObjectName = AcDbAlignedDimension Then
OBJ.Arrowhead1Type = acArrowOpen30
OBJ.Arrowhead2Type = acArrowOpen30
ThisDrawing.Regen acAllViewports
End If
Next

sset.Delete

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

Post to forums  

Autodesk Design & Make Report

”Boost