Annotations - Part to Assembly - Drawing

Annotations - Part to Assembly - Drawing

NachoShaw
Advisor Advisor
1,086 Views
8 Replies
Message 1 of 9

Annotations - Part to Assembly - Drawing

NachoShaw
Advisor
Advisor

Hey

 

Either in code or natively, is there yet a way to get part annotations (specifically dimensions) through assembly level so that they can be pulled as dimensions at drawing level? We are trying to speed up some drawing dimension features by add the dim to the part itself as annotation and pulling it through using the 'Retrieve Model Annotations' so that any parts in the underlying assembly can show the dims but it doesnt seem to work like that. I can use a Base view of a part and get those Annotations and i can do the same with assembly level annotations but not with part level annotations in an assembly into a drawing sheet.

 

An alternative would be to assign assembly level annotations to specific edges that i have names say 'Length' & 'End' that i could call in code.

 

Or

 

iterate through the parts in the baseview, find the assigned edge and attach a dimension to that.

 

anyone else done any work on annotations?

 

 

Thanks

 

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


0 Likes
1,087 Views
8 Replies
Replies (8)
Message 2 of 9

theo.bot
Collaborator
Collaborator

When using the standard interface you can't get the 3d model annotations from part level, it will include the assembly 3d model annotations only. Even when you try the "old" way, retrieving dimensions from features/parts it will only allow you to select parameters/dimension not the 3d annotations.

 

But when you use ilogic/API to retrieve dimensions, both will appear model parameters and the 3d model Annotations. 

Dim oDoc As DrawingDocument
oDoc = ThisDoc.Document 

Dim oView As DrawingView
oView = oDoc.ActiveSheet.DrawingViews(1)

oDoc.ActiveSheet.DrawingDimensions.GeneralDimensions.Retrieve(oView)

It will work even if your part is in a sub assembly. So by retrieving all dimension for an assembly can result and a lot of dimensions what is not great for the performance. 

 

So you could try to filter out the specific dimension using the "GetRetrievableDimensions" function, before you retrieve the dimensions.

0 Likes
Message 3 of 9

NachoShaw
Advisor
Advisor

Hey

 

Thanks for the reply. I feel that dimensions with iLogic in a drawing environment is too much overhead. I can get assembly level 3D annotations into a drawing so i should be able to loop over a parts edges and find assigned names to attach the annotation to. Thats my first call anyway.

 

i'll post back with any meaningful results

 

 

Thanks

 

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


0 Likes
Message 4 of 9

ParametricParadigmist
Explorer
Explorer

Hey NachoShaw -

Did you have any success? I have a program set up to look at every occurrence and currently it can see the .ModelAnnotations but it won't get them to the drawing view.  I tried Theo's suggestion and a few others before like drawingcurves but it's always the 'bringing in' part that fails.  Not sure if you're the same set up, all of our drawings are of a single IAM so detail dims of IPTs are done with a View Rep.

Thanks!

0 Likes
Message 5 of 9

J-Camper
Advisor
Advisor

You can do it with the built in command, you just need to do some extra selections:

0 Likes
Message 6 of 9

ParametricParadigmist
Explorer
Explorer

Thank you very much

0 Likes
Message 7 of 9

NachoShaw
Advisor
Advisor

I would like it come through without using the built in command, that a little clunky. I'm looking for an API way to resolve this

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


0 Likes
Message 8 of 9

ParametricParadigmist
Explorer
Explorer

I agree, it'd be nice to have it recognize the annotations exist and bring those in without the manual selection. Please keep me posted if you have any development.  A coworker and I both have potential programs but we're held up on Inventor recognizing the individual item visible in the view.  I tried renamed entities first and they could be seen but nothing else. 
Thanks again, to both of you!

0 Likes
Message 9 of 9

J-Camper
Advisor
Advisor

So this is really weird, but works in 2025 [Throws an error, but still brings in the annotations]:

Sub Main
Dim PickDV As DrawingView = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingViewFilter, "Select DrawingView")
If IsNothing(PickDV) Then Exit Sub ' If nothing gets selected then we're done
	
Select Case PickDV.ReferencedDocumentDescriptor.ReferencedDocumentType
Case DocumentTypeEnum.kAssemblyDocumentObject
	PickDV.Include3DAnnotations = True
	For Each co As ComponentOccurrence In PickDV.ReferencedDocumentDescriptor.ReferencedDocument.ComponentDefinition.Occurrences.AllLeafOccurrences
		If co.Suppressed Then Continue For
		If PickDV.DrawingCurves(co).Count < 1 Then Continue For
		IncludeModelAnnotations(PickDV, co)
	Next
Case DocumentTypeEnum.kPartDocumentObject
	PickDV.Include3DAnnotations = True
Case Else
	Exit Sub
End Select
End Sub

Sub IncludeModelAnnotations(aDV As DrawingView, PartCO As ComponentOccurrence)
	Dim currentSheet As Sheet = aDV.Parent
	Dim gDims As GeneralDimensions = currentSheet.DrawingDimensions.GeneralDimensions
	Dim retrievableAnnotations As ObjectCollection = currentSheet.GetRetrievableAnnotations(aDV, False, PartCO) 'This only exists in 2025?
	Try
		gDims.Retrieve(aDV, retrievableAnnotations)
	Catch
		Logger.Info("[gDims.Retrieve(DrawingView, ObjectCollection)] Throws an error in 2025, but does still retrieves the annotations??")
	End Try
End Sub


In 2025 we got a new method on the Sheet Object [Sheet.GetRetrievableAnnotations] but at the same time we lost the GeneralDimensions Method to Retrieve annotations [2024 link: GeneralDimensions.Retrieve].  Previous to 2025 you collect your own Model Annotations into an object collection and then retrieve them with the method.

0 Likes