Retrieve 3D Model Annotations on Drawing view using API

Retrieve 3D Model Annotations on Drawing view using API

Raider_71
Collaborator Collaborator
855 Views
2 Replies
Message 1 of 3

Retrieve 3D Model Annotations on Drawing view using API

Raider_71
Collaborator
Collaborator

Hi is this possible at all yet?

0 Likes
856 Views
2 Replies
Replies (2)
Message 2 of 3

dutt.thakar
Collaborator
Collaborator

@Raider_71 

This is not yet possible, because the 3D annotations API are not yet exposed to users. I just recently knew this from an Autodesk guy only, but one thing you can do is trigger the control definition using iLogic and prompt the dialogue box and also write next line which presses the "OK" button for you and it will retrieve all the 3D annotations for you.

 

the control definition for dimension retrieve is  "DrawingRetrieveDimsCmd" and you can use below line of code to execute it.

 

ThisApplication.CommandManager.ControlDefinitions.Item("DrawingRetrieveDimsCmd").Execute

You can also then automate the task so that it automatically selects the view using select set and run this line and choose 3D Annotations and Press OK button, using below code.

 

'ThisApplication.CommandManager.ControlDefinitions.Item("AppContextual_OKCmd").Execute

 

Be aware that the View representations are not working properly and you will not be able to select that in Retrieve 3D annotations using iLogic. You also need to navigate to 3D Annotations tab manually in the dialogue box.

 

I hope this has partly answered you question. If it has, please accept this as SOLUTION.

 

Thanks,

Regards,

Dutt Thakar

If this answer has solved your problem please ACCEPT SOLUTION and hit like if you found it helpful..!


Regards,
Dutt Thakar
LinkedIn
0 Likes
Message 3 of 3

WCrihfield
Mentor
Mentor

Here is some fairly straight forward iLogic code to retrieve 'model annotations' from the model to the drawing, that doesn't include executing any commands.  This rule is set up to retrieve all model annotations from every view, but you can modify it as needed.  The Retrieve() function is where the action is.

If ThisApplication.ActiveDocumentType <> DocumentTypeEnum.kDrawingDocumentObject Then
	MsgBox("A Drawing Document must be active for this rule (" & iLogicVb.RuleName & ") to work. Exiting.",vbOKOnly+vbCritical, "WRONG DOCUMENT TYPE")
	Exit Sub
End If
Dim oDDoc As DrawingDocument = ThisDrawing.Document
For Each oSheet As Inventor.Sheet In oDDoc.Sheets
	For Each oView As DrawingView In oSheet.DrawingViews
		 'can also supply an ObjectCollection of the dims you want to retrieve after specifying the view
		oSheet.DrawingDimensions.GeneralDimensions.Retrieve(oView)
	Next
Next

If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click 'LIKE' 👍.

If you have time, please... Vote For My IDEAS 💡and Explore My CONTRIBUTIONS

Inventor 2021 Help | Inventor Forum | Inventor Customization Forum | Inventor Ideas Forum

Wesley Crihfield

EESignature

(Not an Autodesk Employee)