Fail to get PlanarSketch.Dependents(.Count) Property ("Not implemented" Exception)

Fail to get PlanarSketch.Dependents(.Count) Property ("Not implemented" Exception)

Maxim-CADman77
Advisor Advisor
251 Views
2 Replies
Message 1 of 3

Fail to get PlanarSketch.Dependents(.Count) Property ("Not implemented" Exception)

Maxim-CADman77
Advisor
Advisor

Dear @MjDeck 
Could you, please, comment if it is normal that Inventor produces the "Not implemented" Eexception on attempt to get PlanarSketch.Dependents(.Count) Property on the IPT (2024) attached?


I'm using this iLogic-code:

 

Dim partDoc As PartDocument = ThisDoc.Document ' ThisPart
' Dim compDef As PartComponentDefinition = partDoc.ComponentDefinition
Dim compDef As ComponentDefinition = partDoc.ComponentDefinition

' Dim sk As PlanarSketch = compDef.Sketches(1)

For Each sk As PlanarSketch In compDef.Sketches
	Logger.Info(sk.Name)
	Try
		Logger.Info(vbTab & ".Dependents: " & sk.Dependents.Count)
	Catch ex As Exception
		Logger.Error(vbTab & ex.Message) ' Not implemented (Exception from HRESULT: 0x80004001 (E_NOTIMPL))
	End Try
Next

 

 

PS:
I see the error is somehow related to the fact that End-of-Part marker is not at the top or bottom position (the code produces no exceptions when EoP moved to either top or bottom position).

Please vote for Inventor-Idea Text Search within Option Names

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

bradeneuropeArthur
Mentor
Mentor

This works for Inventor 2025:

 

Dim partDoc As PartDocument = ThisDoc.Document ' ThisPart
' Dim compDef As PartComponentDefinition = partDoc.ComponentDefinition
Dim compDef As ComponentDefinition = partDoc.ComponentDefinition

' Dim sk As PlanarSketch = compDef.Sketches(1)

For Each sk As PlanarSketch In compDef.Sketches
	MsgBox(sk.Name)
	Try
		MsgBox(vbTab & ".Dependents: " & sk.Dependents.Count)
	Catch ex As Exception
		msgbox(vbTab & ex.Message) ' Not implemented (Exception from HRESULT: 0x80004001 (E_NOTIMPL))
	End Try
Next

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
Message 3 of 3

MjDeck
Autodesk
Autodesk

Thanks Arthur. I confirmed that Maxim's original code works in 2025 as well.

@Maxim-CADman77 , it looks like there is a problem in 2024. But it's not only caused by end-of-part. Moving the EOP does not cause this error in all parts.
But in the part you posted, in both 2024 and 2025, if you drag the EOP to the bottom there will be update errors in Extrusion15 and the sketch it consumes.


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes