I wish to set the properties of an assembly using iLogic. I have the values of the properties in a part that is in the assembly. I wish to pass those values from the part to the assemblies iproperties. I tried using the following code, but it gives an error saying it can not find the document "MyAssy.iam"
iProperties.Value("MyAssy.iam", ThisDoc.Path, "Part Number")=AssyNo
I'm not even sure that this is the way to do, but it's the only way I could think of to try.
Thank in advance!
Meck
Solved! Go to Solution.
Solved by meck. Go to Solution.
your close 🙂
you just need to set the iproperties value of your assembly to the iproperties value of the part
here is a small example put something similar in your assembly rule.
the cut and paste screws the code a little, but im sure you will get the idea!
iProperties.Value
("Project", "Part Number")= iProperties.Value("Part1:1","project", "Part Number")
Thanks!
It took me a while to understand what you were saying, but when the light went on I got it to work.
Here is the code that I used...
In the Part1.ipt I created a Custom Property named AssyNo and used the following code to set its value...
iProperties.Value("Custom", "AssyNo")=AssyNoValue
In the assembly I set the Part Number property to the custom property of Part1.ipt.
iProperties.Value("Project", "Part Number")=iProperties.Value("Part1:1", "Custom", "AssyNo")
Thanks for the help. I really appreciate it!
Meck
you are welcome!
Actually there is no need to create the custom property named AssyNo
You can read the project property "part number" directly to your assembly
I did see that I was able to do this, but the Part Number of Part1.ipt is different than the Part Number of the assembly. The part has code that reads from an embedded spreadsheet that lists all the part numbers that make up the assembly. It just happened that this part happens to have that information availiable to it.
I haven't checked yet, but I assume that you still can not pass parameters to an assembly, and that you still can not pass Text parameters at all in 2012?
I am not using 2012 so i cannot say if text parameters can be passed or not 🙂
Not sure i fully understand what you mean by passing parameters to assemblies. This has been possible since INV 2009
Sorry. I meant derive parameters to assemblies from parts. If it is possible, I do not know how to do it.
what you can do is link the part to the assembly and export the parameter values from the part. Then you can use these parameters in your assembly rules
Whoa, I will definitely try that!
Thanks for all your help!
Is there a way to get a property from one part to another part? The parts are not in the same assembly.
I tried using the ilogic code below, but I get the follow error message...
"iProperties:The document named "C:\iLogic Models\MyPart.ipt" was not found."
MsgBox(iProperties.Value(ThisDoc.Path&"\MyPart.ipt", "Custom", "MyProp"))
It might be possible to do this, as yet i have not figured out how. However I would recommend that you do not go down this road!
Referencing parts which are not part of your subassembly will probably give problems. How do you know that the parts will be available ? and if you copy your assembly will you remember to take those parts also?
Other thing is hard coding the path to these parts. If you change the location or share the assembly with a colleague most likely the path will not be the same
Another question within same topic.
Quite often in our workflow we need to create simplified standalone (link is being supressed) parts that represent external geometry of corresponding assemblies.
Of course we use derive component technology.
But problem is: we want those parts inherit all the same iProperties (including custom and applicable physical) with all the same values.
I'm sure iLogic could do the trick but can't decide where to start from.
Any ideas?