Message 1 of 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello
I am trying to change the units of a column to fraction using ilogic
basically access this information through logic
Solved! Go to Solution.
Hello
I am trying to change the units of a column to fraction using ilogic
basically access this information through logic
Solved! Go to Solution.
Hi @NikelARH4K2. We cannot access those column value formatting settings by code yet. We would have to find that specific column by code, then navigate to each cell within that column, and change the String value to look the way we want them to look individually. But then the cell values would likely become 'static', instead of linked / live.
Edit: But out of curiosity, is that column for a 'Custom' iProperty? If so, then is that custom iProperty based on a parameter, that has been exposed/exported? If so, then you may be able to go to the source model documents and change the formatting of those values there, that way they look the way you want them to look within the assembly BOM and PartsList later.
Wesley Crihfield
(Not an Autodesk Employee)
So what i am trying to do is our shop has been asking for a decimal to fraction conversion because they prefer fractional
We would use Item QTY to say how many you need and then i would use unit QTY to show the cut lengths. Unfortunately, frame parts use G_L custom I property and pipe uses PL Custom I property. So cant just pull that custom i property into out BOMs because i wouldnt display both pipe and frame members properly.
^^Unit QTY puts the "in" on only the cut lengths of both pipe and steel frame but leave the other ones "1" without the unit string
So unit QTY is good because it pulls both the frame parts and pipe parts while leaving purchases parts as "1" without any units. So i can use logic to override anything with "1" to be N/A.
But, once i tell it to change it to fractional and give it a unit string it changes the "1" to "1 in" which technically its not even a length. I could do the same to change "1 in" to a N/A but then if we get a 1 in cut length part then it will override it.
My plan was to have logic look down the unit qty column and change all of them to not static, then any cell that has a 1 in it to change it to N/A then it will be constantly checking to make sure its not leaving N/A over something that shouldn't
We often mix pipe and frame members so i cant find a way to make it work
Hi @NikelARH4K2. This type of situation can be complicated to fully understand and deal with. I pretty much never use 'frame' or 'pipe' stuff, so I am not 100% sure if those files will be treated as ReadOnly from Inventor's perspective or not.
If they are not treated as ReadOnly, then we may be able to create a secondary parameter with a common name (same name in frames & pipes) in each of those files, who's value is set to the name of that other parameter (G_L or PL), so that we could use that common parameter to drive the 'Base Quantity' for all those types of parts, then set that parameter to exported, then set the formatting of the custom iProperty that exporting the parameter creates. Then include that custom iProperty as a column in your PartsLists.
Understanding what all those quantity related terms mean can also be confusing. The following is just a quickie explanation of those terms, and how they are controlled on the document side.
BOMQuantity (an Inventor API object used to access those types of settings, in multiple places)
In a drawing, the PartsList is referencing a DrawingBOM, then that DrawingBOM is referencing an assembly's BOM. But the assembly's BOM can not be navigated like a table, like we can with a drawing's PartsList, and we can easily override cell values in a PartsList, and can easily tell if values in a PartsListCell are 'static' or not. So, what you want to do may be possible, but the code may require product/designer specific knowledge built into it to recognize what each row of the PartsList represents, and how they should be handled for the automation code to work properly. We can dig down from the PartsListRow to the DrawingBOMRow, then on to the BOMRow, but it is a little more complicated than it seems like it should be.
As far as keeping the PartsList data updated, since some data may need to be static, there is not really any good event listed in the iLogic 'Event Triggers' for that purpose. The updates may need to be driven from the assembly document side, using one or more custom event handler blocks of code that may be more specific to when BOM related details change.
Wesley Crihfield
(Not an Autodesk Employee)
Ok i found a really dumb way to do it
If i pull the G_L value which if the frame member custom iproperty it shows this
then i do a value substation and have it pull PL which is the pipe property into columns that exist
which will show like this
then apply fractional formatting to the column and the substitutions
Now i cant use the logic to put N/A in the blank rows but thats not big deal because it says "Incompatible Units Error" and i cant have N/A stay in there
Value substitution is not a 'dumb' idea, it is actually pretty smart, and it great for situations similar to this one. I have suggested similar solutions before, but very rarely (if ever) needed to use it myself. Special / extra columns can be used for special cross column calculations/results also, but unfortunately I don't think we can 'hide' those special columns, like we can with rows.
Wesley Crihfield
(Not an Autodesk Employee)