How to get the reference in a part sketch with projected Geometry

How to get the reference in a part sketch with projected Geometry

bradeneuropeArthur
Mentor Mentor
290 Views
3 Replies
Message 1 of 4

How to get the reference in a part sketch with projected Geometry

bradeneuropeArthur
Mentor
Mentor

bradeneuropeArthur_0-1633012256374.png

This part is having a reference to another part in the assembly, by projected geometry.
How can I get the referenced file file via either:

  • I-logic
  • vba
  • vb.net

@JelteDeJong Do you have an idea?

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
291 Views
3 Replies
Replies (3)
Message 2 of 4

WCrihfield
Mentor
Mentor

Hi Arthur.  I have also done a bunch of testing through trial & error cycles on equivalent test files.  I can't find any easy way to get the actual referenced document, other than to actually opening it in the background by executing a command on it, then getting the newly opened document.  Even the PartDocument.AllReferencedDocuments is still zero.  There doesn't appear to be any property of the sketch or any of the sketch's entities that will return this type of reference.  So, the process I mentioned would get the BrowserNode of the sketch, then get its sub node (containing "Reference"), select that, then run one of the following commands on it, depending on which document you want.  The command named "OpenParentAssemblyCtxCmd" will open the assembly where the sketch was made in the context of.  And the command named "OpenCrossRefSourcesCtxCmd" will open the other part(s) that the geometry was projected from.  That's all I can come up with.  They must have not exposed a proper way to deal with this scenario yet in the API, as far as I can tell.

 

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

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 4

JelteDeJong
Mentor
Mentor

I checked for references in the document, sketch and SketchLines but could not find any. I also check if i could extract information using the Adaptive functions. But it seems that ther is only a property to enable/disabel Adaptive. So I could not find any better solution than @WCrihfield suggested.

Dim topNode = doc.BrowserPanes.Item("Model").TopNode
Dim sketchNode = topNode.BrowserNodes.Item("Sketch3")
Dim refNode = sketchNode.BrowserNodes.Item(1)
refNode.DoSelect()
' Dim native = refNode.NativeObject <-- throws exception
Dim command1 = ThisApplication.CommandManager.ControlDefinitions.Item("OpenCrossRefSourcesCtxCmd")
command1.Execute()
Dim command2 = ThisApplication.CommandManager.ControlDefinitions.Item("OpenParentAssemblyCtxCmd")
command2.Execute()

 

Or maybe,  it is a bit of a stretch, but if you know that the assembly is open that was used to create the cross-part projected geometry. Then you could use this to get to the assembly. (this will ONLY work if the assembly is already open!)

Dim doc As PartDocument = ThisDoc.Document
dim assemblyDocument = doc.ReferencingDocuments.Item(1)

If you have the assembly then I expect that you can use this article to get the reference part.

 

Last thought: According to this page the functions in the GUI were added in Inventor 2017. Maybe you can find a "What's new" page from 2017 and have a look if Autodesk added some API functions too...

Jelte de Jong
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.

EESignature


Blog: hjalte.nl - github.com

Message 4 of 4

bradeneuropeArthur
Mentor
Mentor

@JelteDeJong 

@WCrihfield 

How do you take care that with Vault copy design the correct reference is set/updated?

 

Asked the question to Autodesk here:

Large Assembly Modeling Workflows & Vault Copy Design. - Autodesk Community - Vault

 

 

Regards,

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes