How do I....
Create a Content Centre Part that prompts for a filename and sets the Part Number to whatever I save the part as?
It would also be nice to...
Have the browser Display name the same as the saved filename.
If I have a standard part with a blank filename, inventor will make the part number equal the filename at the first save. It is this functionality that I require when using Custom Content parts.
E.G. If I have a length of 'RHS 200x100x6.3 - 2000mm' selected from content centre and I want the filename to be saved as 'Part-001', then I would like the Part Number to be set as 'Part-001'.
If I then place the same member in another project/assembly I may want to call it 'ProjectPart-100', where the part number would then be 'ProjectPart-100' and so on.
This method ignores the filename entry in the Ipart table.
Think I'm missing something obvious, so please point out the solution if you know of one, thanks.
Solved! Go to Solution.
Solved by alessandro.gasso. Go to Solution.
For getting the result you want, please, try the following.
In the Content Center Editor, select the family you have published, right-click, Family Table.
In the Family Table, select the Part Number property, right-click, Column Properties.
In the Column Property dialog set the Expression to {FILENAME} and clear the field “Map To Inventor Property”.
Publish the changes.
Insert the part from the Content Center with the option “As Custom”.
Save the file in the desired location applying the desired name.
The Part Number and the browser Display name will be the same as the saved file name.
I hope it helps.
Kind regards,
Alessandro
Hi,
I am dealing with this same issue. The issue with the above @alessandro.gasso is that it sets the part number equal to the default value of {Filename} not the input value that gets assigned after you create the part. The result being an empty part number. IE I go through content center choose the size, material, length etc. hit okay and right then is the part number set (at this time the filename is blank still). The next prompt is to save and name the file at which point a new file name is given, but that value assigned there is not used to populate the part number. Is there a way to make that value just mentioned populate?
Thanks,
Cameron
Hi! I could be wrong but I suspect the part was not published properly. Is is a standard part or a custom part? Please share an example here. It should be straight forward to figure it out.
Another possibility is that you are on 2021.2 and there was a regression causing column expression to become blank. You will need to install 2021.2.2 update. Or uninstall 2021.2 update for now (install 2021.3 when available).
Many thanks!
I'm actually experiencing the opposite problem. I want to have the part number display in my title block not my filename. But I notice that even though I have the part number selected as the fill for my block it pulls the filename in that selection for each sheet in the document.
Any ideas why this is the case and how I can get the part number call in the drawing to stop spitting out the filename instead of the actual part number?
I would suggest you move or create a new seperate thread as this thread relates to content center part numbers and your question relates to part number retrieval from a view in a drawing. Your post will get a better response also on an unsolved post.
Hi @opcengdept,
As @A.Acheson suggested, please start a new thread and share an example that exhibits the behavior. It should work. But, it is possible there is a bug or some property settings were not set correctly. I would like to understand the behavior better.
Many thanks!
Hi
I'm having the same issue as Cam mentioned above. I have my Family Table set up the same way as indicated by Alessandro however the Part Number property is remaining empty once the custom file is saved. I have confirmed that I am placing the part "As Custom".
I know there are ways to fix this using iLogic, however I would prefer to avoid going to iLogic any time I need to tweak how something is behaving.
I'm on Inventor 2024.0.1 Build 153.
Hi Mac,
I think you mean "by Alessandro" empty definition for PartNumber = no mapping between a column and Part Number property as the PartNumberEmptyDefinitionEditor.png image shows. I revalidated such definition using 2024.1 build (build 209) and I am getting PartNumber same as the FileName - PartNumberEmptyDefinition.png (I also created CC part As Custom). So I am not sure, what I am doing differently. By definition, yes ... If PartNumber definition is empty = no mapping between a CC family table column and PartNumber property then PartNumber should be filled by FileName string
Regards
Jan Priban
Thanks Jan.
For anyone running into a similar issue, below is the iLogic rule I cobbled together to run before assembly save. It's poorly commented and has no error management. Have fun.
Sub Main()
Dim oAsmCompDef As AssemblyComponentDefinition 'Dim everthing, using component definitions instead of Documents for faster scanning. Documents are still used for writing properties.
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition
Dim oDoc As AssemblyDocument = ThisDoc.Document
Dim oDocOcc As ComponentOccurrence
Dim subDoc As Document
Dim docPart As PartDocument
For Each oDocOcc In oAsmCompDef.Occurrences 'Scan for parts in the assembly. If parts are found then set the document variable for the instance.
If oDocOcc.Definition.Type = kPartComponentDefinitionObject Then
subDoc=oDocOcc.Definition.Document
If subDoc.PropertySets.PropertySetExists("ContentCenter") = True Then 'Check to see if custom content center part
If Left(subDoc.DisplayName, 1) = "G" Then 'Check to make sure it follows the naming convention
Try
iProperties.Value(subDoc.DisplayName, "Project", "Part Number") = Left(subDoc.DisplayName, 6) 'Drop the file extension and rename the part number field
Catch
End Try
Else
End If
End If
End If
Next
End Sub
Hi all,
Thank you Mac for iLogic tip / code. As many users I like iLogic that allows to achieve customer specific needs.
To be able to show file name as display name in assembly browser, there is standard Inventor tool
Regards
Jan Priban