Inventor General Discussion

Inventor General Discussion

Reply
Valued Contributor
SteveX82
Posts: 69
Registered: ‎05-26-2010
Message 1 of 25 (4,592 Views)
Accepted Solution

iLogic workflow for suppressing / excluding components

4592 Views, 24 Replies
10-07-2011 10:34 AM

I am working on an iLogic assembly configurator that manipulates several skeletal parts, and suppresses both standard and skeletal parts depending on the configuration.

 

I've been using the Component.IsActive function to suppress all omitted parts, which has prompted me to create a custom Level of Detail. This hasn't caused me much grief until I had completed ~10months of work when it was time for me to make my final assembly drawing and a parts list.

 

I am now running into several deal-breaking issues:

1) Suppressed parts insist on appearing on the Parts List.

2) Saving the assembly drawing reverts my assembly model to the "Master" LOD, which I never, ever, ever want to see again so long as I live.

 

Is there another workflow or technique that I should be using to turn off unwanted components in an assembly? I understand that LOD's are really intended to manage system resources, but Inventor users seem to be left with no other option to display a skeletal assembly in a certain configuration. What is the point of the Component.IsActive function if it doesn't update your assembly (at least so far as the Parts List is concerned)?

 

If I am left to deal with the nightmare that is the Inventor LOD, is there any way to set up the Parts List to reference the custom LOD?

 

Drawing View reps don't seem to be an option, as it looks like there is no way to automatically update the same custom view after the configuration has been made. The iAssembly Include/Exclude feature would handle part inclusion and BOM behavior nicely, but it won't fit into the rest of my iLogic and file management program.

 

Thanks for any suggestions you can provide,

Steve

Valued Mentor
rjay75
Posts: 332
Registered: ‎04-14-2005
Message 2 of 25 (4,578 Views)

Re: iLogic workflow for suppressing / excluding components

10-07-2011 11:22 AM in reply to: SteveX82

iLogic has to have a custom level of detail when suppressing parts. (Usually named <iLogic>). Edit the base view of the assembly in the drawing.

 

In the drawing view dialog there is an option of which level of detail to select. This will also control which BOM to use for the parts list.

 

Check and see what setting the file open options is set to. Level of Detail should be set to Last Active. (Tools > Application Options > File > File Open Options) To get it to stay on the custom LOD switch to it and immediately save. Make sure that's the last active LOD when closing the assembly.

 

While opening an assembly you can also pick options and select the level of detail it opens up to.

Valued Contributor
SteveX82
Posts: 69
Registered: ‎05-26-2010
Message 3 of 25 (4,573 Views)

Re: iLogic workflow for suppressing / excluding components

10-07-2011 11:45 AM in reply to: rjay75

Thanks for your quick reply, Rodney.

 

Unfortunately, the behavior that you describe is not how my assembly and drawing behave.

 

When you get a few free moments, please try the following example:

 

1) Throw two random parts into an assembly file, but place one of them twice (for a total of three parts).

2) Suppress the second instance of the duplicate part, and create a custom LOD. Save and close.

3) Create a drawing and place a base view of your assembly with the custom LOD active.

4) Place a "Parts only" parts list....you'll notice the quantity is incorrect for your duplicate part.

5) Save the idw.

6) Open the assembly back up, and you'll notice it has reverted to the "Master" LOD despite your application options settings and last-saved-as condition.

 

I'm hoping you notice some sort of mistake in my example workflow, or an alternative method of making things work properly. The reversion to the Master LOD isn't exactly a deal-breaker as I last described, but it seems to be a bug that will end up annoying the hell out of the designers down the hall.

 

Thanks again for your help,

Steve

*Expert Elite*
swalton
Posts: 1,201
Registered: ‎06-19-2006
Message 4 of 25 (4,568 Views)

Re: iLogic workflow for suppressing / excluding components

10-07-2011 12:01 PM in reply to: SteveX82

LODs are designed to not change the count in the BOM. 

 

Would you want your count of screws to change when you suspressed all 10k in your assembly so you could fit that iam in 3 GB of ram?

 

My guess is that if you want to change the count of components in your BOM, you will have to delete them and save a copy of the new assembly or use iassemblies.  




Inventor 2014
Vault Professional 2014
Valued Contributor
SteveX82
Posts: 69
Registered: ‎05-26-2010
Message 5 of 25 (4,565 Views)

Re: iLogic workflow for suppressing / excluding components

10-07-2011 12:13 PM in reply to: swalton

If LOD's are designed to not play nicely with iLogic, then I feel Autodesk ought to develop an alternative. At the very least, they could provide us with a Component.Include function that behaves similarly to an iAssembly.

 

What I'm really looking to do with this Configurator is to have a pile of parts in one assembly, and use iLogic (and only iLogic) to resize the skeletal parts as necessary and suppress/exclude/turn off/whateveryouwanttocallit any unnnecssary parts. Manually deleting parts after iLogic is done isn't an option, as it may be desired to include those parts at a later date.

 

Consider this example: we write a bunch of iLogic code to design custom Quonset huts based on a bunch of formulas that are too complex and varied for an iAssembly table. No two huts are the same, but they can come with or without a standard-sized window on the front. Are you saying that there isn't a way to use iLogic to include/excluse a simple window after it has managed to design the rest of the building?

*Expert Elite*
swalton
Posts: 1,201
Registered: ‎06-19-2006
Message 6 of 25 (4,561 Views)

Re: iLogic workflow for suppressing / excluding components

10-07-2011 12:31 PM in reply to: SteveX82

You are fighting the way LODs are intended to be used.  You want to use them for configuration managment.  They don't work for that purpose because they do not change the BOM (by design from AutoDesk). The only use for an LOD is to remove some components from the stack of stuff that IV has to calculate and display at each regeneration. 

 

It looks like if you want to change the BOM you get to use iAssemblies or adding/deleting the extra components from your assembly.

 

I figured that you would have the template assembly with all its ilogic rules and the "pile of components" stored on disk.  Your users would then copy the entire template assembly and all of its components to a new location on disk.  They would then run the configuration rules on the new assembly set.  The ilogic rules would delete or add components as requred by the code.  No issues with LODs and BOMs because you are not trying to supress stuff, you have removed it completely. 

 

 

 




Inventor 2014
Vault Professional 2014
Distinguished Mentor
swordmaster
Posts: 539
Registered: ‎12-15-2008
Message 7 of 25 (4,544 Views)

Re: iLogic workflow for suppressing / excluding components

10-08-2011 09:29 AM in reply to: SteveX82

Steve,

The behaviour you are describing is not normal, I use ilogic and LOD,s to suppress/unsuppress components and the parts list ALWAYS shows the correct component quantity.

 

Here is my workflow

open a new assembly

create a new level of detail (i name mine ilogic as standard but the name is not important)

place 3 instances of a component

create a ilogic rule to suppress instances based on a user parameter

if

suppress_component = 1 then

Component.IsActive

("0061-181410-001:1") = False

Component.IsActive

("0061-181410-001:2") = True

Component.IsActive

("0061-181410-001:3") = True

elseif

suppress_component = 2 then

Component.IsActive

("0061-181410-001:1") = False

Component.IsActive

("0061-181410-001:2") = False

Component.IsActive

("0061-181410-001:3") = True

elseif

suppress_component = 3 then

Component.IsActive

("0061-181410-001:1") = False

Component.IsActive

("0061-181410-001:2") = False

Component.IsActive

("0061-181410-001:3") = False

else

Component.IsActive

("0061-181410-001:1") = True

Component.IsActive

("0061-181410-001:2") = True

Component.IsActive

("0061-181410-001:3") = True

end if

 

so by changing the parameter value i can control how many instances are active

save and close the assembly

 

start a new idw

create a base view

browse to the assembly file

select the ilogic level of detail from the drawing view interface

place the view

create the "parts only" parts list

quantity shown is the number of active instances

save idw and close

open the assembly (it opens in the ilogic lod )

change parameter value triggering ilogic rule which changes the instance quantity

save and close

open the idw

the parts list has updated to the revised instance quantity.

 

As i said i do this all the time with no issues. One word of warning is not to have the assembly AND the drawing open at the same time........this causes problems.

 

I am using INVENTOR 2009

 

Inventor 2010 Certified Professional
Valued Contributor
SteveX82
Posts: 69
Registered: ‎05-26-2010
Message 8 of 25 (4,532 Views)

Re: iLogic workflow for suppressing / excluding components

10-10-2011 04:48 AM in reply to: swordmaster

Thanks agian to both of you for your replies.

 

I've noticed that there is a difference in how the Parts List is affected by either manually suppressing a component VS using iLogic Component.IsActive to do the same.

 

* If a component is manually suppressed (as in my example), the parts list and quantities are "incorrect" and reflect the Master LOD's Parts List.

* If iLogic is used to suppress a component (as in swordmaster's example), then the parts list and quantities are "correct" and reflect the active custom LOD.

* In both cases, the assembly undesirably (at least in my opinion) switches to the Master LOD after saving the drawing, closing the drawing, and reopening the assembly. This causes all of the unneeded suppressed components to appear on the designer's screen until I remind them to manually switch back to the iLogic LOD. This process is repeated every time the drawing is opened and saved, and I'd really prefer for the assembly to just stay the way it was last saved.

 

If Autodesk intends for LOD's to control visualization and system resources only, then why are Parts Lists affected by one suppression workflow and not the other? Is this inconsistency also intentional?

Active Contributor
Shawn_79
Posts: 37
Registered: ‎06-17-2010
Message 9 of 25 (4,518 Views)

Re: iLogic workflow for suppressing / excluding components

10-10-2011 09:41 AM in reply to: SteveX82

The iLogic component.isActive also changes the BOM structure to REFERENCE which is what removes it from the BOM.  If you manually suppress a part you must first change the BOM structure to Reference for the BOM to be correct.

 

I have written two iLogic rules to help with this situation.  The first will perfrom the component.isActive = False to a selected item and the second reviews the assembly and checks for suppressed parts that do not have a Reference BOM structure and prompts the user to change them.  The first rule is shown below.  If you are interested in the second rule let me know and I will clean it up and post it.

 

 

'Suppress Selected Item

'Get currently selected component
Dim oOccurrence as ComponentOccurrence
Try
 oOccurrence = ThisDoc.Document.SelectSet.Item(1)
Catch
 MessageBox.Show("Please select a component before running this rule", "iLogic")
 Return
End Try
 
 'Set the selected item
oOccurrence = ThisApplication.ActiveDocument.SelectSet.Item(1)

Component.IsActive(oOccurrence.name) = False

 

You can also use ilogic code to set the current LOD.  We have noticed that Inventor will sometimes change to Master LOD (somewhat random, or at least I haven't picked up on the pattern yet.)

 

ThisApplication.ActiveDocument.ComponentDefinition.RepresentationsManager.LevelofDetailRepresentations("iLogic").Activate

 

 

-Shawn

 

 

Active Contributor
Shawn_79
Posts: 37
Registered: ‎06-17-2010
Message 10 of 25 (4,502 Views)

Re: iLogic workflow for suppressing / excluding components

10-11-2011 03:36 AM in reply to: Shawn_79

The attached text file contains a rule that will check the current model browser tree for the following conditions and prompt to fix them:

 

Suppressed parts with an BOM structure not equal to Reference

Active parts with a BOM structure of Reference

Parts with visibiltiy turned off

 

It also includes provisions to ignore certain browser names such as "SKEL".  Virtual parts are also ignored.

 

We use this with our iLogic configurator in order to make sure the BOM reflects the model state.

 

All outputs are written using the trace.writeline command see the following thread for details.

http://forums.autodesk.com/t5/Autodesk-Inventor/iLogic-Developing-and-debugging/m-p/2845670/highligh...

 

 

-Shawn

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.