Modifying Content Center Parameter.

Modifying Content Center Parameter.

Jacob.PawelskiUVPDL
Contributor Contributor
1,085 Views
4 Replies
Message 1 of 5

Modifying Content Center Parameter.

Jacob.PawelskiUVPDL
Contributor
Contributor

So I was looking into creating a custom content center library for the company I work for. It is strictly for Frame Generated structural members, so your beams and channels, ect.

There are 4 things I want to accomplish with this. 
1.) Material defaults to appropriate designation. (A36 for W-beams, A500 for HSS, ect.)
2.) Length Parameter exports as Architectural Units. So a channel of length 20.5 inches would export as 1'-8 1/2"
3.) Add an iLogic rule to modify part length string if there is a leading 0 for inches. (say my part is 12.5" long. Even if I correctly change the export property for the length variable above, it would show up as 1'- 1/2". I need it to show up as 1'-0 1/2". I wrote a rule to do this for normal parts, but I need to add this to the content center parts as well)
4.) Description modified to show material, Member type, size and length, all formatted correctly. 

5.) Change the unit quantity to each instead of length.  So that 20.5" channel would show up on the BOM as (1) unit of a 20.5" channel.

Currently I am manually doing this for every member I use in Frame Generator. It is manageable, but not ideal. Mistakes are made, parts are missed or partially completed, and the drawing's BOM is off. 

Currently, I am able to do 1 & 4, but 2, 3 & 5 are eluding me. Is there an .ipt file somewhere I can modify? Or am I going about this the wrong way, and I should be exploring an iLogic rule that runs from the assembly level and makes these modifications? 

See attached images if it's unclear what I am looking to change. 

Thanks,
Jacob

0 Likes
Accepted solutions (1)
1,086 Views
4 Replies
Replies (4)
Message 2 of 5

Jacob.PawelskiUVPDL
Contributor
Contributor

I found the following in the iLogic forums last night. This code allows me to change Custom User Parameters from the assembly level on all Content Center Parts. So item 2 above is also solved with this. Just needing 3 & 5. 
I attached the code incase anyone else is wanting to do the same. 

Public Sub Main()
Call UpdateCustomProperties
End Sub

Public Sub UpdateCustomProperties()
' Get the open top-level assemby.
Dim asmDoc As AssemblyDocument
asmDoc = ThisApplication.ActiveDocument

' Get a list of all documents referenced by this assembly.
' This property will return everything at all levels.
Dim refDocs As DocumentsEnumerator
refDocs = asmDoc.AllReferencedDocuments

' Iterate through the documents.
Dim doc As Document
For Each doc In refDocs
' Look for part documents.
If doc.DocumentType = kPartDocumentObject Then
' Look for a parameter named "G_L".
Dim params As Parameters
params = doc.ComponentDefinition.Parameters

On Error Resume Next
Dim param As Parameter
param = params.Item("G_L")
If Err.Number = 0 Then
' the custom property format.
Dim propFormat As CustomPropertyFormat
propFormat = param.CustomPropertyFormat

propFormat.Precision = CustomPropertyPrecisionEnum.kSixteenthsFractionalLengthPrecision
propFormat.Units = "ft"
propFormat.PropertyType = CustomPropertyTypeEnum.kTextPropertyType
End If
On Error GoTo 0
End If
Next
End Sub

Message 3 of 5

jan_priban
Alumni
Alumni

Hello Jacob,

 

#3

If you have an iLogic rule that formats your length string for normal part, you can use same iLogic for Content Center part. It is trick I used more times. Content Center allow to use template IPT file having iLogic rule "inside" + you can define event trigger, I usually use OnBeforeSave. So as you know, Content Center consists of template and family table data. Template parameters are filled by family table data / values and this way Content Center part is made. Family template is IPT, basically family template is iPart that you publish and published Content Center family is based on. So feel free to add iLogic rule into iPart and authorize / publish. Also for existing families it is possible to replace family template (see help how to do that)  - this way you can replace family template without iLogic by family template with iLogic rule

 

#5

I am not BOM expert, but I know BOM allows to use column Item QTY. Item QTY calculates beam / frames as pieces, not summarizing length. If Item QTY does not suite your requirements, iLogic is alternative here as well. In such case you need to calculate QTY by yourself like QTY = ceil(CurrentLength / 20.5), e.g. you need 2 pieces of 20.5 long frame if you need 20.6 total frame length

Ceil(20.6/20.5) = 2

.  

Regards

 

Jan Priban

Message 4 of 5

Jacob.PawelskiUVPDL
Contributor
Contributor
Accepted solution

Thank you for your reply Jan. 

I figured most everything out yesterday and implemented it this morning successfully. 
Solution is as you said, using alternative ipt document for my custom content center library. 
I had created a custom library copied from the ANSI library. What I did not know was that you could replace the Family Template by right clicking on the custom family as shown below. So I placed a generic piece of each family, modified the ipt with ilogic rules, forms, custom parameters, ect. and then did that replace family template and bam, done!

Inventor Forum 4.png

Message 5 of 5

jan_priban
Alumni
Alumni

Hello Jacob,

 

nice to hear you found solution you were looking for ... Thanks for feedback

 

Jan

0 Likes