Copy Design while using iLogic

Copy Design while using iLogic

j_span755F8
Contributor Contributor
355 Views
2 Replies
Message 1 of 3

Copy Design while using iLogic

j_span755F8
Contributor
Contributor

Hi there,

 

We made a parametric model using iLogic to supress parts and subassemblies that are not needed. 

Now we want to make a copy design of this whole model so we can make project specific changes to it. 

 

We need the parts that are parametric to get new part numbers, and the "Standard" parts need to stay the same (so like in a normal copy design).

But those new partnumbers dont refer to the iLogic rules. 

This completly breaks the iLogic and makes it unusable.

Is there a way to do this.

Right now we can copy design but than the paramteric part of the model completly loses it functionality.

 

We also get sometimes  errors while CDing (like "Given key was not found in dictionary")

 

Please someone help us 🙂

Thanks ahead for the one that can help us.

 

(sorry for my english, i'm not a native speaker)  

 

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

A.Acheson
Mentor
Mentor

Hi @j_span755F8 

Have you stabilized the occurrence names within the code? See help page here.

Another more in depth article here

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 3 of 3

robertast
Collaborator
Collaborator

I didn't like @Anonymous's code. I changed it a little and now it performs stabilization correctly

oDoc = ThisDoc.Document
oNamer = "Normalise Browser Nodes"
Dim UNDO As Transaction 
UNDO = ThisApplication.TransactionManager.StartTransaction(oDoc, oNamer)
Dim doc = ThisDoc.Document : If doc.DocumentType = kAssemblyDocumentObject Then 'Check we are in an IAM
Else : Return :End If

Dim oDef As AssemblyComponentDefinition = oDoc.ComponentDefinition
Dim oCompOcc As Inventor.ComponentOccurrence

For Each oCompOcc In oDef.Occurrences
GetOccName = oCompOcc.Name

Try
NewName = GetOccName & "_" & 5
oCompOcc.Name = NewName

NewName2 = (GetOccName.Split("_5")(0)) ' Removes "_5" from the Browser Node
oCompOcc.Name = NewName2

Catch : End Try : Next