How to delete all feature control frames in my sheet

How to delete all feature control frames in my sheet

artemijs.nille
Contributor Contributor
583 Views
6 Replies
Message 1 of 7

How to delete all feature control frames in my sheet

artemijs.nille
Contributor
Contributor

i would like to delete all feature control frame in my sheet (see picture below)

Launching this code:

 

Dim oDoc As Document = ThisApplication.ActiveDocument
Dim oSheet As Sheet
Dim oFCF As FeatureControlFrame

For Each oSheet In oDoc.Sheets
	For Each oFCF In oSheet.DrawingDimensions
			oFCF.Delete
	Next 
Next

 

i get following message:

 

Unable to cast COM object of type 'System.__ComObject' to interface type 'Inventor.FeatureControlFrame'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{F3E768AB-B2BC-42B4-B95F-ED49BE550257}' failed due to the following error: Schnittstelle nicht unterstützt (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

 

how can get this code to work?

0 Likes
Accepted solutions (1)
584 Views
6 Replies
Replies (6)
Message 2 of 7

bradeneuropeArthur
Mentor
Mentor

Put a 

 

Try

##.delete

Catch

 

End try

 

And the code between.

 

Regards,

 

Arthur 

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 7

artemijs.nille
Contributor
Contributor

Thank you for a reply.

I dont get an erroe message anymore, but all FCF are still there.

So the code doesnt work.

Any ideas?

0 Likes
Message 4 of 7

bradeneuropeArthur
Mentor
Mentor

Will have a look!

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 5 of 7

artemijs.nille
Contributor
Contributor

Hi,

could you find a reason why it does not work?

Thank you in advance.

0 Likes
Message 6 of 7

WCrihfield
Mentor
Mentor
Accepted solution

Hi @artemijs.nille.  Simple mistake is causing Type mismatch.

For Each oFCF In oSheet.DrawingDimensions

Should be:

For Each oFCF In oSheet.FeatureControlFrames

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 7 of 7

artemijs.nille
Contributor
Contributor

Thank you very much it helped

0 Likes