Controlling Arrowheads on Drawing Dimensions with VBA

Controlling Arrowheads on Drawing Dimensions with VBA

204Е10
Enthusiast Enthusiast
1,318 Views
4 Replies
Message 1 of 5

Controlling Arrowheads on Drawing Dimensions with VBA

204Е10
Enthusiast
Enthusiast

Hi everyone,

can help me someone to find how to create ilogic rule to control the arrowhead on chain dimensions, sometime this misleading people on drawings.

I have found the property to chain but really I don't know to create the routine.

Thanks.

Note. 

DimensionStyle.ArrowheadTypeForChainDimensions() As ArrowheadTypeEnum

Name

Value

Description

kFilledArrowheadType

71941

Filled arrowhead.

 

Examples for other use of arrowhead.

https://forums.autodesk.com/t5/inventor-customization/controlling-arrowheads-on-drawing-dimensions-w...

https://forums.autodesk.com/t5/inventor-customization/adding-holethreadnote-to-correct-side-of-hole-...

 

0 Likes
Accepted solutions (2)
1,319 Views
4 Replies
Replies (4)
Message 2 of 5

YuhanZhang
Autodesk
Autodesk
Accepted solution

Here is iLogic code sample, in UI you select a chain dimension, and run the iLogic code in a rule:

 

Sub Main()
	Dim oDoc As DrawingDocument
	oDoc = ThisDoc.Document
	
	On Error Resume Next
	Dim oChainDim As LinearGeneralDimension
	oChainDim = oDoc.SelectSet(1)
	

	oChainDim.FirstArrowheadType = ArrowheadTypeEnum.kFilledArrowheadType
	oChainDim.SecondArrowheadType= ArrowheadTypeEnum.kFilledArrowheadType

End Sub


If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

0 Likes
Message 3 of 5

204Е10
Enthusiast
Enthusiast

How I can applicate this rule in every section of the chain without pick one by one?

Like set on the Edit Dimensions Style>Display>Termantor>Intermal chain terminator> Filled

 

Many thanks for you time and help.

 

0 Likes
Message 4 of 5

YuhanZhang
Autodesk
Autodesk
Accepted solution

The API for changing the terminator in the dimension style is not available yet, but you can use the iLogic to batch changing the arrowhead of all the linear dimensinos like below:

 

Sub Main()
	Dim oDoc As DrawingDocument
	oDoc = ThisDoc.Document
	
	Dim oSheet As Sheet
	oSheet = oDoc.ActiveSheet
	
	On Error Resume Next
	Dim oLinearDim As LinearGeneralDimension
	Dim oDim As GeneralDimension
	
	For Each oDim In oSheet.DrawingDimensions.GeneralDimensions
		If oDim.Type = ObjectTypeEnum.kLinearGeneralDimensionObject Then
			oLinearDim = oDim
			
			oLinearDim.FirstArrowheadType = ArrowheadTypeEnum.kFilledArrowheadType
			oLinearDim.SecondArrowheadType = ArrowheadTypeEnum.kFilledArrowheadType
	
		End If
	Next
End Sub

Just run the rule and it will update all the linear dimensions' arrowhead on the active sheet. Hope this helps.



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

Message 5 of 5

204Е10
Enthusiast
Enthusiast

Thanks it run perfectly.

0 Likes