Hi
I am after a code snippet that accesses the base qty field ,by default this is set to g_l length when we use frame generator to build stud walls we require this iproperties to be each and have the ability to run at assenbly level
Has anyone got any code i can cut and paste into my existing rules .
Any help would be appreciated
Dave
Dave,
I'm not sure what you want to do. Can you provide more details, and maybe post a sample assembly with the rules that you're using now?
Hi dclunie,
Here's a bit of code to toggle a part from G_L to Each. It may need to be incorporated into a larger rule to run it at the assembly level.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
booleanParam = InputRadioBox("Select Base QTY type", "G_L", "Each", True, Title := "iLogic")
If booleanParam = True then
'set the Base Quantity to the parameter Length
p = Parameter.Param("G_L")
Call ThisDoc.Document.ComponentDefinition.BOMQuantity.SetBaseQuantity(BOMQuantityTypeEnum.kParameterBOMQuantity, p)
Else
'set the Base Quantity to the parameter Each
Call ThisDoc.Document.ComponentDefinition.BOMQuantity.SetBaseQuantity(BOMQuantityTypeEnum.kEachBOMQuantity)
End if
iLogicVb.UpdateWhenDone = True
Hi Curtis
you have sorted some code out for me before in relation to frame generator to fix description and file name could this solution be added to snippet of code that you gave me before. a screen shot attached to area that i am trying to change
during the ilogic run on save event.
Code snippet is below that you provided me with before
''kUnknownDocumentObject = 12289 'kPartDocumentObject = 12290 'kAssemblyDocumentObject = 12291 'kDrawingDocumentObject = 12292 'kPresentationDocumentObject = 12293 'kDesignElementDocumentObject = 12294 'kForeignModelDocumentObject = 12295 'kSATFileDocumentObject = 12296 'kNoDocument = 12297 Dim openDoc As Document openDoc = ThisDoc.Document Dim docFile As Document If openDoc.DocumentType = 12291 Then For Each docFile In openDoc.AllReferencedDocuments If docFile.DocumentType = 12290 Then Dim FNamePos As Long FNamePos = InStrRev(docFile.FullFileName, "\", -1) Dim docFName As String docFName = Right(docFile.FullFileName, Len(docFile.FullFileName) - FNamePos) 'select for part files with specified material If iProperties.Material(docFName) = "TIMBER" Then 'set description iProperties.Value(docFName, "Project", "Description")= "=<G_L> X <G_W> X <G_T>" 'set part number to file name iProperties.Value(docFName, "Project", "Part Number") = Left(docFName, InStrRev(docFName, ".") - 1) End If End If Next Else MessageBox.Show("You must have a valid Assembly document open before using this code!", "File Type Mismatch!") End If
Regards
D Clunie
hi
I have just responded to Curtis Waquespack as he has posted a solution but any extra help would be appreciated
Regards
D Clunie
Hi dclunie,
I gave this a quick try and wasn't sucessful. Hopefully Mike will jump in and offer something. If not I'll try and have another look later.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
I've done a bit of googling and found this post, and tried your snippet of iLogic code below & it worked well. I'm just wondering if it could be tweaked slightly. Is there a way to remove the prompt box that asks you for base quantity type and only trigger the rule if there is a parameter renamed to G_L as you had below? (in my case it would be named length).
Reason being I would like to put it in our part template but if the other draftsman don't want to use it, it wont hinder them or pop up and 'annoy' them. So if there is no parameter named G_L the rule would not run, and base quantity would stay at each.
Thanks,
Joe