- Tool Palette Images for Custom Lines Update
- Creating Custom Image for Process Line Palettes
When adding new process line types, you generally do not get a good images on the tool palettes. The out of the box line images are stored in a resource dll, so modifying those isn’t really an option.
On the topic of lines, be sure to check out these links for tips on creating your own line types:
Today’s article is going to show how to add a custom line class using a custom line type, and the create a image for the tool palette. Hang on, this is going to get a little lengthy!
Here is what we are going to get as our final output:
You can download the line file I used here:Line with Insulation Linetype (58 downloads)
Add the Linetype to the project
To load the line type into the project, open up the projsymbolstyle.dwg for your project.
Use the LINETYPE command to open the Linetype Manager, and click Load
Locate the pdoteam.lin available for download and click Open.
Select the Line with Insulation and click Ok.
Save the projsymbolstyle.dwg and close it.
Create a New Line Segment Class
Since we are going to create a new symbol, remember to switch your palette group to PnID PIP, and navigate to the Line tool palette.
Open Project setup, navigate to P&ID DWG Settings > P&ID Class Definitions > Engineering Items > Lines > Pipe Line Segments. Right-click Pipe Line Segments and select New.
Enter these values, and click ok.
With the new class selected, move over to the right and click Edit Line.
Use these settings, note that the line is using Show Flow Arrow, the Linetype we added is selected, and Gap priority is set to 1.
Click Ok, and then click Add to Tool Palette.
You should see something like this, which doesn’t really let the user know what the line will look like when it is inserted.
Create an Image for the new Line Segment
UPDATE: Brian Tait, from Cheniere suggested a much better workflow: http://www.pdoteam.com/2013/09/tool-palette-images-for-custom-lines-update/
The best way to get a good image size is to draw a short line segment and zoom out to where it appears to match the size/scale of the default images.
You can use the Snipping Tool in Windows, or a similar screen capture software like Jing or SnagIt (my favorite).
My selection looks like this:
Save the screen clipping at a location you’ll remember.
Modify the Image to have a Transparent Background
While I could have used any number of tools to do this step, I thought I’d walk you through another Autodesk program, Pixlr.
In Pixlr (click the previous hyperlink), you can upload your image. Choose Open Image from your computer when the site loads.
and select the clipped image we just created.
Your image size should be around 64×64 (that’s the largest size the tool palette can use without scaling). Use the resize image tool if you need to change the image size.
Next we need to get our line work to a new layer in the image (sounds harder than it is).
On the left in the tool panel, click the wand tool.
With the wand tool active, click in the blank area.
The wand tool selects everything that is enclosed within a boundary. In this case, it is selecting the blank space. To get it to select the line work, click the Edit menu, and choose Invert Selection.
Next click the Edit menu, and then Copy.
Click the Edit Menu and Paste.
Our selected line work is now put on a new transparent layer (see Layers at right).
Double-click the lock icon beside the background layer, and then delete the Background layer.
You should have Layer 1 with our lines and a background with square all over it (means transparent).
Now, go to File > Save and save your image back to your computer.
Apply the New Image to the Tool Palette
Home stretch…! Back in AutoCAD, find the Lines palette, and right click on the Line with Insulation icon, and select Properties.
Right-click on the image and choose specify image, and select the image you downloaded from Pixlr.
Your new line icon should end up looking like this: