Archive | May 2012

Launching External Programs and CADpilot

by Mark Stefanchuk, CADmanage.com

Yesterday I was looking at launching external applications from my favorite CAD programs. Launching standard Windows office applications are generally supported, but I wanted to see if I could launch an executable developed by someone other than Microsoft. Sure enough, there are several posts out there that document how to do this, but I thought it might be helpful to see how to handle it in both MicroStation and AutoCAD. And many of our CADpilot customers have asked the same thing, specifically “how do I launch an external application using CADpilot?” So, I’ve included a couple of CADpilot examples too.

MicroStation

In MicroStation this is easy. Use the “%” symbol before the application name. For example,

%snagit32

As long as snagit32.exe is found in a PATH folder the program will launch. If it’s not in the path then you can always be explicit. For example,

%"C:\Program Files (x86)\SDJElectra\SegmentTables\Program\segmenttables.exe"

The quotes are necessary because there are spaces in the path spec.

AutoCAD

In AutoCAD it takes a little more effort, but you can do it. The START command will launch most windows programs found in PATH. If it’s not found in path you will need to use the SHELL command. For example,

SHELL "C:\Program Files (x86)\SDJElectra\SegmentTables\Program\segmenttables.exe"

These will start a command window which then executes the request.

You can also set up an alias by editing the acad.pgp file. To open this file in Civil3d go to the Manage tab on the ribbon menu and click “Edit Aliases”. This will open the file in notepad. You can find more information on how to add aliases for external programs from the knowledgebase article, Starting Windows programs from the AutoCAD command line.

The interesting thing about the alias file is that it is user specific. If you do a Save-As from notepad you will see that the acad.pgp file is located in the users AppData folder. It will move with the user’s roaming profile, but everyone could have a different acad.pgp.

That’s great. It gives your users control over their personal CAD environment. On the other hand, you will have to do some planning if you, as the CAD Manager, make changes to this file and want to deploy it to everyone on the team.

CADpilot

A somewhat biased plug – this is one of the many reasons I like CADpilot. The user can create her own aliases and you can deliver program launch commands for the whole team, or for segments of your team to a single location. Also, since CADpilot is a delivery and deployment platform you can make global changes very easily without making users exit their design session.

Ok, so for those of you already using CADpilot, launching commands is really easy. You use the “cadpilot ui run” command. In MicroStation it will look like this,

cadpilot ui run snagit32

and for AutoCAD,

(cadpilot-ui-run snagit32)

If you need to spec the whole path then use the following format.

(cadpilot-ui-run "C:/Program Files (x86)/SDJElectra/SegmentTables/Program/segmenttables.exe")

In the editor it would look like this.

On my development menu I’ve just added it as a test – like this,

It looks the same in both MicroStation and AutoCAD, there’s no DOS command shell opened when the command launches, and I only had to deploy it to one location.

I also discovered, today, that I can add my own variables to cadpilot.ui.cfg file. I added,

MYPATHVAR = C:/mydevpath/

The new commands for MicroStation and AutoCAD,

You don’t have to exit the CAD application either, just reload the menu.

If you’re not already a CADpilot user, download the demo version from cadmanage.com.

About Mark Stefanchuk: Mark is a VP and senior consultant with CAD Management Resources, Inc. He divides his time between developing innovative custom software solutions and helping clients navigate complex design automation environments. If you would like to find out how he can assist you with your design technology he can be reached by contacting us at info@cadmanage.com.

Advertisements

Don’t sink, drawing “arks” in AutoCAD and MicroStation

by Seth Cohen, CADmanage.com

I’m at home, and tropical storm Beryl is upon us showing how much rain she can dump down on the earth.  We’re getting blasted, and the puddles are starting to turn into ponds, and I’m thinking of Noah’s ark, when it dawns on me, hey, I’ll do a tip on Arc’s for MicroStation and AutoCAD.  Ok, I know, I need to get out more.

Let’s do MicroStation first.  In MicroStation, it’s really user-friendly.  To start the Arc command, choose it in the Drawing Task.

Place Arc Command

Next, in the Tool Settings window  (and this is really why it works so well) set the appropriate settings, and MicroStation will automatically give you a nice preview of the arc before you even place it.  You can keep on changing the settings, and the preview will update automatically.  Don’t forget, unlike AutoCAD, you can draw arcs tangent to other objects like lines, linestrings, complex shapes, etc.  MicroStation will also give you the two solutions as well.

Preview Placement of Arc

AutoCAD is a little different in that you need to choose the command sequence option first in the Ribbon, and then “answer the questions” next.  There are many different options available and you can pretty much get the arc you need by choosing the appropriate one from the Ribbon: Draw Panel > Arc drop-down

Different Arc Command Sequences

Different Arc Command Sequences

Below are some tips to “get the points” you need to complete the arc.

  • To complete an arc in the other direction, simply type a negative value in the angle prompt.
  • There will be times when you will need to draw perpendicular lines from the end point of a line to the center of the arc to complete the arc.
  • Sometimes it’s easier to use the circle command and then trim out the parts you don’t need to generate the arc.

So now, if it starts to rain heavy feel safe knowing that you can always draw an “ark”, to save you.

“Now you know, and knowing is half the battle.”  …………G.I. Joe

P.s. On another note, CADmanage will be at FLUG (Florida Local Users Group)  next week, June 6-8.  We will have a booth, and if you are in the Cape Canaveral area, come by and visit us.  FLUG is one of the greatest user groups, and there are classes and presentations for both AutoCAD and MicroStation.  Visit http://www.flugsite.com for more information.  Hope to see you there.