Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Content Centre Prompted Filename and Part Number

10 REPLIES 10
SOLVED
Reply
Message 1 of 11
AndyO
1383 Views, 10 Replies

Content Centre Prompted Filename and Part Number

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.

10 REPLIES 10
Message 2 of 11
alessandro.gasso
in reply to: AndyO

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.

 

FT.png

 

In the Family Table, select the Part Number property, right-click, Column Properties.

 

CP.png

 

In the Column Property dialog set the Expression to {FILENAME} and clear the field “Map To Inventor Property”.

 

PN.png

 

Publish the changes.

Insert the part from the Content Center with the option “As Custom”.

 

AsCustom.png

 

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



Alessandro Gasso
Fusion 360 – Simulation/Generative Design Adoption Specialist
Autodesk, Inc.
Message 3 of 11

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

Message 4 of 11
johnsonshiue
in reply to: AndyO

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!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
Message 5 of 11
opcengdept
in reply to: johnsonshiue

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?

Message 6 of 11
A.Acheson
in reply to: opcengdept

@opcengdept 

 

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. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
Message 7 of 11
johnsonshiue
in reply to: opcengdept

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!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
Message 8 of 11
R_MacMurchy
in reply to: AndyO

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.

 

R_MacMurchy_0-1690483845944.png

 

Message 9 of 11
jan_priban1
in reply to: AndyO

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

 

 

Message 10 of 11
R_MacMurchy
in reply to: AndyO

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

 

 

Message 11 of 11
jan_priban1
in reply to: R_MacMurchy

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

 

janpriban_0-1690962209030.png

 

Regards

 

Jan Priban

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report