Adding sizes to the custom parts palette

Every now and then we get asked how to add sizes to the custom parts palette.  While I’ve said no, I always try to dig a little more to find out where those sizes get pulled from. This morning, I found it!

2015-08-06_9-06-12

 

Adding a Size to permanent (CustomParts) Items

 

The critical piece is to understand where the sizes load from. You would think that it would read from the Custom Parts spec for the current project.

2015-08-06_9-08-09However, it turns out there is a different location that it reads from. <Shared Content Folder>\CPak Common\CustomPartsSpecs\, or on a system with the default installation directory, C:\AutoCAD Plant 3D 2016 Content\CPak Common\CustomPartsSpecs.

Because we can open the CustomParts spec in the spec editor, adding a new size is as simple as

  • Opening the spec

2015-08-06_9-19-04

  • Finding the catalog item

2015-08-06_9-20-42

2015-08-06_9-21-34

2015-08-06_9-22-26

  • And adding a new size to the catalog and spec

2015-08-06_9-23-52

2015-08-06_9-24-51

Adding a size to PlaceHolder Parts

This step is a little trickier because the spec editor doesn’t allow opening the placeholder spec, and we don’t have a Place Holder catalog.

The placeholder spec used to load sizes is located here in the project spec sheets folder.

“P:\2016 Demo\Spec Sheets\PlaceHolder Imperial.pspc”

To open it in the spec editor we need to use a SQLite database utility. My personal favorite is: http://sqliteexpert.com/download.html

Open the pspc file in SQLite expert and locate the RepositoryDescriptor table. Set the name to CustomHolder Imperial, then scroll to the right and set the ContentType  from Placeholder to Customholder (just a different value). Make sure to click the post edit check mark in the row above to save the changes to the database. Close SQLite.

2015-08-06_9-59-57

Open the PlaceHolder Imperial.pspx in the spec editor.

 

2015-08-06_10-02-38

The other part of the problem is that a Placeholder catalog is not distributed with the product (they probably thought we wouldn’t figure it out…hehehe).  However, I used the Catalog builder to recreate a catalog based on the Placeholder Imperial spec. You may download it here:

Placeholder Imperial Catalog (6 downloads)

While we have a catalog, because we don’t have the original, we can’t edit the existing part. So to fix the size, remove the PH Imperial Valve from the spec. Add your required sizes into your catalog and spec.

After your spec is updated, open the pspc in SQLite and then set the RepositoryDescriptor Name and Content type back to Placeholder instead of Customholder.

2015-08-06_10-06-07