Tips, Tricks, and Insight into Process and Power Software

Creating Custom Image for Process Line Palettes

This entry is part 2 of 2 in the series Custom PnID Lines

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:

 

http://www.thecadmasters.com/wordpress/index.php/2013/01/10/creating-custom-autocad-linetypes/

http://www.cad-notes.com/2009/05/creating-your-own-autocad-line-type/

http://www.afralisp.net/autocad/tutorials/custom-linetypes.php

http://www.afralisp.net/autocad/tutorials/complex-custom-linetypes.php

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:

image

You can download the line file I used here:

[Download not found]

 

Add the Linetype to the project

To load the line type into the project, open up the projsymbolstyle.dwg for your project.

 

SNAGHTML5b3bc4a

Use the LINETYPE command to open the Linetype Manager, and click Load

SNAGHTML5b53b68

Locate the pdoteam.lin available for download and click Open.

SNAGHTML5b5ad4c

Select the Line with Insulation and click Ok.

SNAGHTML5b60a88

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.

image

Enter these values, and click ok.

SNAGHTML5b75905

With the new class selected, move over to the right and click Edit Line.

image

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.

SNAGHTML5b8ca3e

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.

image

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).

image

My selection looks like this:

image

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.

image

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.

image

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.

image

With the wand tool active, click in the blank area.

image

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.

image

Next click the Edit menu, and then Copy.

image

Click the Edit Menu and Paste.

image

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.

image

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.

image

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.

image

Right-click on the image and choose specify image, and select the image you downloaded from Pixlr.

SNAGHTML5d4f516

Your new line icon should end up looking like this:

image

Series NavigationTool Palette Images for Custom Lines Update