Manage CADWorx Project Resources with Symlinks

This tip is not limited to CADWorx. It can be applied to many types of files that CAD users may need, I have simply decided to demonstrate how “Symlinks” can help a common frustration for CADWorx users and CADWorx administrators.

First – What is a “Symlink”?

Symlinks can be manually created using the Windows command line as shown here: http://php.net/manual/en/function.symlink.php

I personally don’t like using the Windows command line because it always seems to be so touchy and easy enter an error. So with a little help from a quick google search, there happens to be a nice (free) user interface dialog box that lets you create Symlinks with all of the options that are available to symlinks in the Windows command line.

Link to the free symlink creator: https://code.google.com/p/symlinker/

SymLink Creator Link

 

Here is a suggestion for how to administer a project using CADWorx and its various modules like P&ID, Plant, Equipment and even Electrical available here: http://www.ecedesign.com/ElectroMOD

As shown below, a sample folder structure for an oil & gas company named “Cletus Oil & Gas Co”.

Notice that under the the main folder that contains the name of the Client & Project, there are 3 folders. This varies from company to company, but there is usually a “WIP” folder (Work In Progress). This is where the designs and CAD files are placed. In the example I have shown, I think that it makes sense to control the order of these folders. That is why there is a “1” before “WIP” and an underscore before “Project Resources” These are the 2 folders that are relevant to this post.

_Project Resources is the folder where the CAD admin could place the needed files that the client has either provided and/or you have created for them in order to use their standards… The “Plotting” folder normally contains the needed .ctb files for the project. The “Templates” folder could contain the various .dwt files as well as title blocks. But for the example for CADWorx, notice the CADWorx folder and how it is broken up into sub-folders of the various modules of CADWorx.

In each of these folders, there are mainly 3 files that we are concerned with:

  1. .cfg file – Configuration file that defines various settings for CADWorx but also lists the path where the next 2 files can be found.
  2. .cat file – Catalog file defines parts or “Components” that are found in actual manufacturers parts catalogs. a multitude of additional information can be defined in the .cat file
  3. .prj file –  Project file defines what parts (“Components”) are needed for a project. This file pulls the components from the .cat file and also defines what information needs to be pulled from the catalog and how it should be displayed.

SymLink CADWorx Project Resources

As you might know, the folder in which you open a .dwg file is also considered a “support path,” So a common practice, is to copy the .cfg files into the various WIP folder so that the CADWorx users can have the proper components for a project. The more complex the project, the more these files can be scattered about a project. An obvious issue is how sloppy this can be and difficult to manage. If something were to change in the .cfg file, you will need to make sure to re-copy it into the many WIP folders so that they all get the updates as well.

This is where adding a symlink to the various .cfg files can be a real life saver and also a clean way to make changes to one file and all of the other files receive the updates automatically. Some of the benefits are obvious but you might need to take the extra time needed to set the project up in the beginning and communicate to the team how this works.

Launch the “Symbolic Link Creator” tool

Change the top drop-down list to “File symbolic link” this will allow you to create the symlink to a specific file. In our case, the .cfg file

Link File Area (middle area of dialog box). Click the “Explore” button and navigate to the folder where you want the link to go. IMPORTANT – Give the file a name INCLUDING the file type extension. Sidenote – CADWorx looks for the first .cfg file in its support paths and if the file is named “Project.cfg” that one takes precedence. That is why I named it “Project.cfg”.

“Destination File (Lower portion of the dialog box). Click the “Explore” button to navigate to the .cfg file you want to be the “Master” file located under the “_Project Resources” folder.

Repeat for the various folder that you want to have “copies” of the .cfg file

Symbolic Link Creator Dialog box

Note that the file that is created in the various folders does have the correct Icon as a .cfg file but it has a little arrow in the lower left of the icon that you normally see on desktop icons. It also doesn’t have any file size and under the “Type” column it shows as a “Configuration File”

Link In Folder

When CADWorx sees this file in the folder, it is actually reading from the .cfg file located under the “_Project Resources” folder. This is important to understand and communicate to the rest of the project team. If they make changes to the .cfg file in their folder, it is going to make those changes to the “Master” file and therefore make changes to the rest of the folders that have links to the “Master” .cfg file.

I think that after some good documentation and communication to the people working on the project, the benefits of using symbolic links will pay off and also add value to the project by knowing that changes to the project are live and everyone will get the most up to date changes.

What other uses can you think of that Symbolic Links can be used for? Share your thoughts below in the comments section.

SymLink CADWorx Project Resources2

Click to Enlarge

Posted in CADWorx, Customization, Manage, TIPS | 2 Comments

AutoLISP: Split Dimensions

This is a re-post of a previous post that deserves to be re-posted. The routine was posted at theswamp.org by Kerry and can be found here: http://www.theswamp.org/index.php?topic=33493.msg389031#msg389031

The routine simply splits an existing dimension and lets you click a point between the dimension to define a new inner dimension.

Here’s how:

  • SPLITDIMS [enter] to start
  • Select dimension to split
  • pick a new point

SplitDims


(defun c:LegLengthMod ( / ss dimobjs)
  
  ;; codehimbelonga KerryBrown@theSwamp 2010.05.28
  ;; http://www.theswamp.org/index.php?topic=33493.msg389031#msg389031

  (vl-load-com)
  (if (and (setq ss (ssget '((0 . "DIMENSION"))))
           (setq dimobjs (mapcar 'vlax-ename->vla-object
                                 (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
                         )
           )
      )
    (foreach dim dimobjs
      (vla-put-extlinefixedlensuppress dim :vlax-true)
      (vla-put-extlinefixedlen dim (* 2 (vla-get-textheight dim)))
    )
  )
  (princ)
)


(defun c:SplitDims (/ sel newpt ent edata elist)
    
  ;; codehimbelonga KerryBrown@theSwamp 2010.05.28
  

  (if (and (setq sel (entsel "\nSelect Dimension to Split."))
           (setq newpt (getpoint "\Select new Dim Point"))
      )
    (progn (setq ent   (car sel)
                 edata (entget ent)
                 elist (vl-remove-if
                         '(lambda (pair)
                            (member (car pair)
                                    (list -1 2 5 102 310 300 330 331 340 350 360 410)
                            )
                          )
                         edata
                       )
           )
           (entmod (subst (cons 14 newpt) (assoc 14 elist) edata))
           (entmakex (subst (cons 13 newpt) (assoc 13 elist) elist))
    )
  )
  (princ)
)
Posted in AutoLISP, AutoLISP: Dimensions, AutoLISP: Modify, Dimensions | 1 Comment

AutoLISP: EXTRIM Between Two Edges

The LISP routine featured today is by Marko Ribar and can be found at CADTutor.net at the following Link: http://www.cadtutor.net/forum/showthread.php?88293-EXTRIM-Between-Two-Lines&p=605998&viewfull=1#post605998 If you have any questions or requests or even saying a “Thank you” to Marko, about the routine, please post them at the forum. I am sure that Marko would like to know if he needs to tweak anything and would appreciate any gratitude.

Please copy the code from the CADTutor link above

The routine uses the concept of the EXTRIM command that is found in the Express Tools and applies this approach to trimming objects that cross both of the selected edges (boundaries).

Here’s how:

  • EXB2C [enter]
  • Select 2 separate objects to define the trimming edges
  • Click the cursor between the 2 edges that you selected to define the area that you want trimmed.

EXB2C 3 EXTRIM

 

Note that if objects do not cross both of the edges that you select, the outcome seems to not want to trim certain objects (shown below).

EXB2C 2

But if this is the scenario that you encountering, you should just use the Express Tool EXTRIM to accomplish what you need (shown below). You might also find the following link to another LISP routine that puts a spin on the EXTRIM command as a helpful tool as well: http://autocadtips.wordpress.com/2012/03/08/autolisp-trim-objects-on-one-side/

EXB2C 3 EXTRIM

Posted in AutoLISP, AutoLISP: Modify, Express Tools | Leave a comment

Don’t Forget that CADWorx P&ID Cfm.shx file

This issue comes up rather often when dealing with projects that use CADWorx. Some users use CADWorx and other people in the same project don’t. Perhaps they want to simply open a P&ID drawing (or other drawing that uses this file for linetypes) with just “vanilla” AutoCAD and upon opening the drawing they are greeted with the ever-annoying prompt that says: “One or more SHX files are missing. What do you want to do?”

Cfm shape file 1A

If you don’t have CADWorx installed on your machine, simply ignore this so that you don’t alter the drawing and how it is supposed to look/display. Then go find someone who does have CADWorx and ask if you can copy the “compiled shape file” (That is what an .shx file is…) and copy it to you your AutoCAD support path.

Most likely the culprit is the .shx file called “Cfm.shx” and it is located in the default CADWorx support path on your C: drive as shown below.

In the example below, I am using AutoCAD 2013 with CADWorx P&ID 2013. Your versions will vary but the file name of “Cfm.shx” remains the same. Also not that when you browse to your AutoCAD support path, it will not be the same as mine after the “Users” portion…

Cfm shape file 2

Shown below are some of the linetypes that use this .shx file that are unique and therefore, you can see why you wouldn’t want to simply replace the linetype upon opening…

Cfm shape file 1

Cfm Shape File 3

 

Posted in CADWorx, Customization, Linetypes, Manage | Leave a comment

Issues With Using DEFPOINTS for Viewports

It may seem like a great idea to use the layer “DEFPOINTS” as the layer for your viewports since it doesn’t plot by default. And you may have heard from various posts that you shouldn’t do so but may have not understood why…

Here’s why:

It has to do with both Layer 0 (zero) and Defpoints.

Note: I am using “Layer 0 (zero)” because I dont want the zero to be confused as the capital letter O.

Layer zero is reserved for objects like blocks so if they are set to layer zero and you insert them into a drawing, the current layer could be set to anything, and that block will now be on that layer. So CAD managers might have Layer 0 (zero) turned off or even frozen so that people don’t use this layer to draw objects that should be on a designated layer.

If layer 0 (zero) is not turned off or frozen, you can select everything as normal (shown below

1 All Layers Selectable

Let’s say that you Freeze Layer 0 (zero) [shown below]

2 Freeze Layer Zero

Now try to select the same layers that were select-able prior to Layer 0 (zero) being frozen. You will notice that you cant select the objects that are on the DEFPOINTS layer. It’s like some sort of force field has been applied to these objects…

3 Try to select Objects on Defpoints

 

So how will this cause issues?
If your viewports are on the DEFPOINTS layer, and you want to later come and change the scale of the viewport, you will not be able to select the viewport. However, you can still double click inside the viewport to adjust the scale but some people use DEFPOINTS for placing other objects that they don’t want to plot like text that serve as notes or whatever. If they later what to erase them or move them or edit them, they wont be able to do so.

4 Example of viewport on DEFPOINTS

Posted in BASICS, Layers, Layout, Manage, Paper Space, Trouble Shooting, Viewports | 3 Comments

BASE Command – BEWARE of XREFs & Blocks

A perplexing issue crept its way into a project recently that revolves around the AutoCAD command BASE [enter].

This command can be found on the “Home” tab > Block panel (drop down – lower portion) “Base

Base 1

It can also be found on the “Insert” tab > “Block Definition” panel (drop down – lower portion) > “Set Base Point” button

Base 1-2

 

Note the description of the command as it is hovered over in the tool tip. It sounds like a description but it should also be a WARNING.

When you run the BASE command in a drawing note that the coordinates should be o,o,o (zero,zero,zero) [shown below].

Base 2

If the BASE command is run and these coordinates have been changed, notice the warning that appears (shown below). It seems to be more concerned about the Z coordinate not being set to zero than anything, but at least it lets you know that this has been changed.

Base 3

 

Using the BASE command can be useful for when you have a series of blocks that are in a folder and each drawing is an individual blocks. If for some reason, a block needs to have its insertion point moved, it might be easier to open the drawing and run the BASE command and then simply snap to a point to define the new “BASE” point, then trying to select all of the objects that make up the block and then move them to the coordinates (0,0,0).

But if you have dynamic blocks or properties of a block that require it to be opened and edited in the “Block Editor,” you are out of luck. The below warning will appear telling you that the BASE command will not work in the Block Editor.

Base5

 

Now here is the important thing to remember or at least try if you have a problematic drawing/model. Here is the scenario – An Electrical designer had a 3d model referencing all of the other disciplines (Piping, Structural, Civil, & Mechanical) and when he had his drawing opened, everything looked correct. But when every other discipline opened their model, everything was fine EXCEPT the electrical model. This is because somewhere along the process, the BASE command was used and was snapped to some random object. And as the description says, this will be the “Origin” or Base Point that other drawings will process and use when this drawing is inserted as a block or XREFed into their drawings.

Luckily, if the BASE has been changed, you can later use the BASE command and it will show the new coordinates – meaning it will not show (0,0,0) allowing you to easily enter these values thus fixing the XREF issue.

Posted in Blocks, Manage, Modifying, XREFs | 1 Comment

Turn On CADWorx Ribbon Tabs and Menu Bar

If you have lost your CADWorx Ribbon tabs or Menus (from the menu bar) you can simply load them by using the following in the command line:

LOADMENUPLANT [enter]

CADWorx ribbon tabs and menu

CADWorx 2013 and AutoCAD 2013 are shown in the above pic

For loading the CADWorx Equipment palette or toolbars see the following post: http://autocadtips.wordpress.com/2013/06/21/cadworx-equipment-palette/

A friend of mine also has a great blog post explaining how to load both the CADWorx Plant and Equipment modules in the same session found here: http://streamlined-design.blogspot.com/2013/07/use-acadrx-to-load-cadworx-plant-and.html

Please keep the Streamlined Design blog in mind for some terrific advanced AutoCAD customization tips & techniques for CAD managers and CAD admins. There are also some .NET programming examples available

~Greg

Posted in CADWorx, Manage | Leave a comment