USC to USC I-Logic
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I replace assemblies with I-Logic. The coded worked when I place the Rule directly in the assembly I like to change.
I try to move the rule in an assembly one level higher, because I like later to edit more sub assemblies with one Forms.
For both codes I get this error message. The error message is only for "Constraints.AddUcsToUcs" . "Constraints.Delete" doesn't work but I get no error message.
Error in rule: RAILING_FRONT_1, in document: 1472586_IAM_000.iam
Constraints.AddUcsToUcs("Railing holder left", "CS_EIN") : The component named "Railing holder left" was not found.
More Information TAB
System.ArgumentException: Constraints.AddUcsToUcs("Railing holder left", "CS_EIN") : The component named "Railing holder left" was not found.
at iLogic.CadAssemblyUtil.FindComponent(Document rootDoc, ComponentArgument comp, String visibleCallerName, String entityName)
at Autodesk.iLogic.Runtime.InventorEntities.UcsFinder.GetUcs(Document document, ComponentArgument component, String ucsName, String visibleCallerName)
at Autodesk.iLogic.Core.ManagedAssembly.UcsToUcsConstraintFactory..ctor(ManagedConstraints managedConstraints, String constraintName, String[] linkedConstraintNames, ComponentArgument component1, String ucsName1, ComponentArgument component2, String ucsName2, Object[] offsets)
at iLogic.ManagedConstraints.AddUcsToUcs(String constraintName, ComponentArgument component1, String ucsName1, ComponentArgument component2, String ucsName2, Object xOffset, Object yOffset, Object zOffset, String[] linkedConstraintNames)
at ThisRule.KorlattartoModositas()
at ThisRule.Main()
at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)
Select Case PA_GL1_RAILING_HOLDER Case "FIXED" Component.Replace("Railing holder left", defaultPath & "/1264067_IAM_000.iam", True) ' USC delete and create Constraints.Delete("CS_EINtoCS_AN_LEFT") Constraints.Delete("CS_EINtoCS_AN_LEFT_XZ") Constraints.Delete("CS_EINtoCS_AN_LEFT_YZ") Constraints.AddUcsToUcs("CS_EINtoCS_AN_LEFT", "Railing holder left", "CS_EIN", "RAILING_FRONT_1", "CS_AN_LEFT", xOffset := 0, yOffset := 0, zOffset := 0)
Select Case PA_GL1_RAILING_HOLDER Case "FIXED" Component.Replace("Railing holder left", defaultPath & "/1264067_IAM_000.iam", True) ' USC delete and create Constraints.Delete("CS_EINtoCS_AN_LEFT") Constraints.Delete("CS_EINtoCS_AN_LEFT_XZ") Constraints.Delete("CS_EINtoCS_AN_LEFT_YZ") Constraints.AddUcsToUcs("CS_EINtoCS_AN_LEFT", "Railing holder left", "CS_EIN", "", "CS_AN_LEFT", xOffset := 0, yOffset := 0, zOffset := 0)
I also tried to write the assembly name into the "Constraints.AddUcsToUcs" command
Constraints.AddUcsToUcs("CS_EINtoCS_AN_LEFT", "RAILING_FRONT_1/Railing Holder left", "CS_EIN", "RAILING_FRONT_1", "CS_AN_LEFT", xOffset := 0, yOffset := 0, zOffset := 0)
Is there a option to select the "root" assembly for the complete I-Logic Rule? Or do I have an error in my command lines?