Delete iAssembly (Convert to normal part)

Delete iAssembly (Convert to normal part)

a81383
Enthusiast Enthusiast
171 Views
1 Reply
Message 1 of 2

Delete iAssembly (Convert to normal part)

a81383
Enthusiast
Enthusiast

Hello,

I'm trying to delete the whole iAssembly factory and just be left with a normal part. The following code works great for iParts but throws an error when trying to delete an iAssembly.

 

oDef = ThisApplication.ActiveEditDocument.ComponentDefinition

'For iParts

Dim oFactory As iPartFactory
oFactory = oDef.iPartFactory

 'For iAssemblies

Dim oFactory As iAssemblyFactory
oFactory = oDef.iAssemblyFactory
oFactory.Delete()

 

 

0 Likes
Accepted solutions (1)
172 Views
1 Reply
Reply (1)
Message 2 of 2

a81383
Enthusiast
Enthusiast
Accepted solution

Found it! I had a broken constraint that was Excluded in my iAssembly. Therefore, I didn't realize I had a broken constraint and once I repaired the broken constraint the above code and conversion works perfectly. 

0 Likes