I was given this scrip:
It is suppose to be for sing Rules to supress a folder on the model tree. Can someone please explain this script to me please?
For an example I have a folder "0-59" and this folder needs to be on if LENGTH <=60 inch. How would I put that in?
And just for all credits due, this script was from jdkriek on form post:
http://forums.autodesk.com/t5/Inventor-Customization/Supress-entire-folder-How/m-p/3589854#M39778
Hi ASchlaack,
Here is a quick example iLogic rule:
LENGTH = InputBox("Enter a Value ", "iLogic", 50) oApp = ThisApplication oDoc = oApp.ActiveDocument oPane = oDoc.BrowserPanes("Model") oTopNode = oPane.TopNode If LENGTH <= 59 Then 'Get the browser folder object oFolder = oPane.TopNode.BrowserFolders.Item("0-59") 'Get the set of nodes in the folder oFolderNodes = oFolder.BrowserNode.BrowserNodes 'Cycle through each browser node in the folder For Each oNode As BrowserNode In oFolderNodes oComp = oNode.NativeObject ‘suppress folder contents oComp.Suppress Next Else If LENGTH >= 60 and LENGTH <= 120 Then 'Get the browser folder object oFolder = oPane.TopNode.BrowserFolders.Item("60-120") 'Get the set of nodes in the folder oFolderNodes = oFolder.BrowserNode.BrowserNodes 'Cycle through each browser node in the folder For Each oNode As BrowserNode In oFolderNodes oComp = oNode.NativeObject ‘suppress folder contents oComp.Suppress Next Else End If
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Ok, so I get where to put the numbers but how should I link the folders to that rule?
Hi ASchlaack,
As I understand it you have multiple browser folders in your assembly. And you want to run the iLogic rule and have it do one of these:
A ) The iLogic rule will read a parameter that was manually changed by the user, and then suppress the contents of one of the folders based on the parameter value.
or
B ) The iLogic rule allows the user to change the parameter, and then suppresses the contents of one of the folders based on the parameter value.
However, I suspect the best way to do this is:
C ) Start off with the all of the of the folder contents suppressed. Then the iLogic rule allows the user to change the parameter and then unsuppresses the contents of one of the folders based on the parameter value.
or
D) Start off with the all of the of the folder contents unsuppressed. Then the iLogic rule allows the user to change the parameter and then suppresses the contents of one of the folders based on the parameter value.
In anycase I don't follow your question about "linking" the folders. Could you provide more details about what you mean by "linking" and which of the above options (A-D) sounds like what you're after? If none of them sound right, please provide further details (maybe even some screen shots), and I'll try and come up with a workable example.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
I think I'm not saying the correct thing... I get what your saying to do but i have NO clue how to do that.
I have 5 folders:
*The one named ALWAYS ON obviously I want to always be unsupressed.
And I have a user parameter "LENGTH"
When LENGTH <= 60 inch I want folder 0-59 to be the only one unsupressed.
When LENGTH >60 inch AND <= 120 inch I want folder 60-119 to be the only one unsupressed.
When LENGTH >120 inch AND <= 180 inch I want folder 120-179 to be the only one unsupressed.
When LENGTH >180 inch AND <= 240 inch I want folder 180-239 to be the only one unsupressed.
Hi ASchlaack,
Attached is an assembly file and a part file that you can use to see how I've set this up. I've used different values that are base on the component occurrence number, rather than the part lengths, just to keep things simple for my example, but it should give you a good idea of how to proceed with your objective.
Basically I've set up multiple simple rules, and then I have a main rule that runs some of the other rules based on the value of the Parameter named LENGTH. The rules that get run control the suppression of the browser folder contents.
Here is what the Main Rule looks like:
To test these files you can just save the assembly and it will automatically run the rule named Main Rule. Or you can run it manually from the iLogic Rule Editor Tree. There is also a rule named Reset, that you can run manually.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Curtis, that is awesome! Thank you so much! I'll take a look at this and hopefully this should get this to work finally!
I transfered your rules all over but I'm now getting this:
Any ideas on whats going on?
hi,
when i tried saving assembly in LOD level, it gave me an enedless loop. it kept asking me test value. I have to end inventor process in task manager.
do you know why?
thanks.
That would mean two things are dependent on eachother for a parameter... can you post what your working on?
Hi ASchlaack,
Concerning Unsuppress error, this is a method of ComponentOccurrence not BrowserFolder, so I'm guessing you have a mistake in your code. In case of a doubt, simply open the API Help Files and look for the method you are invoking:
Regards,
Philippe.
i am using the files you posted. I didnt change anything. I can save the file in master level not LOD. thanks.
I'm not sure, I was never able to get it to work at all.. I ended up taking a very different approch to get a working result.
Can't find what you're looking for? Ask the community or share your knowledge.