Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
werft60
in reply to: WCrihfield

I'm at a loss with this one, I'm getting a "The parameter is incorrect.". I checked the oNamedFace variable and it doesn't come back as Nothing so it should contain the right face object. I'm not sure how the proxy could be wrong either. 

Dim oADef As AssemblyComponentDefinition = oAssemblyDoc.ComponentDefinition
Dim oSubAsm As ComponentOccurrence = oADef.Occurrences.ItemByName(DoorName)
Dim oSubComp As ComponentOccurrence = oSubAsm.Definition.Occurrences.ItemByName("Stile:1")
Dim oNE As NamedEntities = iLogicVb.Automation.GetNamedEntities(oSubComp.Definition.Document)
Dim oNamedFace = oNE.TryGetEntity(YZFace)
Dim oNFaceProxy As FaceProxy
'Error Happens Here
oSubAsm.CreateGeometryProxy(oNamedFace, oNFaceProxy)

 

Alternatively is it possible to insert a rule into a document? That way I could separate this batch of code into its own rule and run it within the new assembly document. This way I could just use the original code I was using and it would reference the right data.

 

Or is there anyway to run an external rule on a specific document? I know for internal rules you have to specify a document but with external rules they don't.