iLogic External Rule to Set parameter in component part
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have an external rule that is recursively running through all parts within an assembly. Among other things, it sets a parameter I called "FileName" to a string that will then get saved as the new file name, replaced in the assembly, and so on.
Here is a extract from the code that I am using.
Dim oDoc As Document = RuleArguments("Document") Dim CurFileName = oDoc.FullFileName Logger.Trace("oDoc in FileNaming = " & CurFileName) Dim FileNamePara = Parameter(oDoc, "Series") Logger.Trace("FileNamePara = " & FileNamePara) Parameter(oDoc, "FileName") = Parameter(oDoc, "Series") & Parameter(oDoc, "Family") & Parameter(oDoc, "OptionCode") Logger.Trace("FileName after FileNaming rule = " & Parameter(oDoc, "FileName"))
And a case of the logger.
TRACE|Entering external rule: FileNameing (from 100-00003-0035.iam)
TRACE|oDoc in FileNaming = C:\_FCPWorkspace\Designs\Engineering Projects\15301-15400\15338\Outputs\Drawings\AngleRinforcement.iam
TRACE|FileNamePara = 100-
TRACE|OptionCode in FileNameing = 0010
TRACE|FileName after FileNaming rule = 100-00003-0010
The part AngleRinforcement.iam parameters are
Series = 300-
Family = 00164-
Option Code = 0010
This issue is that it is setting the parameter in the parent file only. oDoc is the correct file name, The option code is correct for that file name, but when it comes to setting the parameter, it finds it only in the parent part number, ie 100-00003 instead of 300-00164 for the part. What am I doing wrong here?