Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Community
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

API Support to promote model dimensions to 3d annotations

API Support to promote model dimensions to 3d annotations

Hallo , 

 

in the current inventor UI you can use the 'promote' command to promote model dimensions/ sketch dimensions to a 3d view. 

 

Holzethekid_0-1588183356907.png

The current Api does not support this function.

 

Please add the function to the API!

 

6 Comments
bguillory2
Contributor

For sure would be of benefit in my case.

juergen.matt
Explorer
Very important to automate MBD
gharveyMHN58
Contributor

This would be extremely useful for those who have a large amount of models with existing tolerances in feature dimensions, allowing for automatic generation of MBD data. 

gharveyMHN58
Contributor

If you would like to promote all sketch dimensions to a 3d annotation then the below will achieve this, the annotations will appear with the text in the same position as the sketch dimension text. 

 

Dim partDoc As Inventor.Document
partDoc = ThisApplication.ActiveDocument
Dim oCompDef As PartComponentDefinition = partDoc.ComponentDefinition
Dim modeldims As ModelDimensions = oCompDef.ModelAnnotations.ModelDimensions

Dim oSelectSet As SelectSet
    oSelectSet = partDoc.SelectSet
    oSelectSet.Clear

'Wrap adding all annotations within a single 'UNDO'
oDoc = ThisDoc.Document
oUndoName = "iLogic Promote 3D Annotations"
Dim UNDO As Transaction 
UNDO = ThisApplication.TransactionManager.StartTransaction(oDoc, oUndoName)
'Code inside UNDO here:
'-------------------------------------------------------------------------------------------------------------------------------------

For Each oSketch In oCompDef.Sketches 'go through each sketch in the model
	
	oSketch.Visible = True 'make the sketch visible
	oSketch.DimensionsVisible = True 'make the dimensions visible

	'select all the dimensions in the sketch
	For Each oDim In oSketch.DimensionConstraints
		oSelectSet.Select(oDim)
	Next

	Call ThisApplication.CommandManager.ControlDefinitions("3daPromoteDimensionCmd").Execute 'promote the dimensions to 3d annotations
	
	'if you dont see annotations try this line below
	'Call ThisApplication.CommandManager.ControlDefinitions("PartVisibilityCtxCmd").Execute 
	
	oSketch.Visible = False 'hide the sketch again
	oSketch.DimensionsVisible = False

Next
'-------------------------------------------------------------------------------------------------------------------------------------
UNDO.End

 

Yijiang.Cai
Autodesk
Status changed to: Accepted

This has been accepted as [INVGEN-42224].

dan_szymanski
Autodesk
Status changed to: Implemented

This idea has been implemented within Autodesk Inventor 2023. Special thanks to everyone who cast a vote for it.

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

Submit Idea  

Autodesk Design & Make Report