Tuesday, December 23, 2008

On the 11th day of CAD...

On the 11th Day of CAD I give to you..... Free Visual Basic and some information on connecting to AutoCAD.

Well Santa Bill (Bill Gates and Microsoft) gives us free programming tools. This is great news considering I remember back in the day when I first started doing VB stuff it was roughly $900 or more which stopped me from buying my own version. This meant I only had VBA tools, or the version at the office. Well with Santa giving us the Express Version of VB, C++, C# we can now do some coding at home and learn some really cool things. There are some limitations with this however for most of our needs I think it will work. Enough talk about how cool this is, lets give you some links to where you can get it.

One of the main things I noticed with the express editions is that you can't set an application to run when debugging. What this means to us for AutoCAD programming is one of two things, You either have to write the code to start up AutoCAD in your VStudio project to allow you to debug, or not be able to step through your code. Not a huge deal but I like to be able to step through my code when coding for AutoCAD. Now keep in mind, this doesn't mean you can't debug for projects that aren't being written to connect to AutoCAD or any other application for that matter.

One other note, is that you can get a discounted price on Visual Studio with this promotion. I found out about this at Kean Walmsley's blog. (www.through-the-interface.typepad.com) This is a great resource for AutoCAD programming using Visual Studio.

It is probably also worth mentioning that you can get some templates that help you connect to AutoCAD and pre-build some of the information you need into your VS project. See this post from Kean for more information.

I hope this helps.

Monday, December 22, 2008

On the 10th day of CAD...

On the 10th Day of CAD I give to you..... an easy way to create scripts for a specific list of drawings.

In AutoCAD There are so many times you can save yourself quite a bit of time by cutting out the repetative tasks. For example when completing a project and preparing to send your final documentation one might want to zoom extents on all of the drawings. Possibly even do more things to the drawings before sending them to your customers. In the video below I outline this on a few drawings. I hope this helps.

Note: You will probably want to turn your SDI to 1 in AutoCAD. This will automatically close each drawing after it is processed.

Tuesday, December 09, 2008

Rules Based Design for Autodesk Inventor

While I was "stationed" at Autodesk University I had an opportunity to go see some old friends in the exhibit hall where I came across this cool tool for Autodesk Inventor. iLogic from Logimetrix Inc, allows designers / engineers to enter rules into their design. For example let's say I had a model of a Parker Cylinder, something we all use quite often I am sure, I could enter the rules for that design into iLogic. Let's just say these rules are the same rules that would be needed to build one of the part numbers so things like series, stroke, etc.... I can now have anyone in my organization utilize this one model for any of that family of cylinders and always have the correct ordering information. I can also ensure that they don't accidentally make design mistakes due to forgetting to interpret one of the rules based on the manufacturers website.

I found this tool to be very useful within the first 20 seconds of talking with Dave from Logimetrix. Dave is the Director of Development and was able to easily articulate the purpose of this software. The great thing I found about this add in was the flexibility to build rules into anything I can think of to design. You have access to all of Inventor's API's as well as some built in iLogic tools to help with this rules based design. A rule doesn't have to be a design rule either, it could be something as simple as show a dialog box. Autodesk has another product called Inventor Professional Automation which allows you to do a lot of the same things, but this one seems to be easier to use. It also seems that it is much easier to create your own dialogs to use in your rules based designs. One last thing about this product versus the Inventor Automation product (I am not an Inventor Automation Expert) is it seems that with Inventor Automation you change a bunch of values in your "worksheet" then apply those changes to your model. After applying those changes to your model, Inventor Automation then modifies parameters in your model giving you the end result. With this iLogic tool it seems as when you change a value in your worksheet it updates the model almost instantly.

Don't take my word for it, go check it out at www.logimetrixinc.com. Let me know your thoughts and maybe we can all learn a little something along the way.

Thanks again to Dave from Logimetrix Inc for getting me hooked on this product. :-)

Tuesday, November 25, 2008

Fix Me....

Alright, I have been babbling a lot about non CAD things for a little while. Now it's time to talk about some AutoCAD Electrical stuff I used in the past. Basically the concept is to have a block named fix_me that you insert this symbol into your drawing where you know you need to do some rework. This symbol could have the intelligence that trims out your wires, has descriptions etc... Then when you use the next / previous drawing tools it automatically finds this block, then zooms in on it. Here is the information from the help file on how to do it.

You can set up to have an AutoLisp utility run each time you open a project drawing from the project manager or the "next/previous" toolbar button picks.


  • Create and test the AutoLisp utility that you want to execute as each drawing opens.
    Open the "wd.env" file with a text editor, find the "WD_OPEN_DWG" line and un-comment it (remove the leading (*) character and insert a call to your self-starting AutoLisp routine.
    Save the wd.env file and restart AutoCAD Electrical.
    Make sure your utility loads (either automatically or through an explicit load included in the command string.
  • A simple example: you want to be able to insert a special "fix me" block on a drawing as a reminder that something needs further attention. If this block exists on a drawing when it is opened from the project manager window or from the next/previous toolbar buttons, then the drawing will zoom up on the block before anything else happens. Here's the AutoLisp utility you might create to do this (saved as file name "fix_me.lsp" and saved to a folder in the AutoCAD search path):

(defun c:fix_me ( / ss en ed xy)
  ; Look for any block insert on the drawing with a block name of "FIX_ME"
  (setq ss (ssget "_X" '((-4 . "<AND")(0 . "INSERT")(2 . "FIX_ME")(-4 . "AND>"))))
  (if (/= ss nil)
    (progn ; one or more found. Zoom up on the first one found
      (setq en (ssname ss 0)) ; entity name of first or only block
      (setq ss nil) ; release the selection set
      (setq ed (entget en))
      (setq xy (cdr (assoc 10 ed))) ; block insertion point
      (command "_.ZOOM" "_CENTER" xy 1.0)
      (princ "\nThis needs attention!!!\n")
  ) )   

Here's the uncommented line in the wd.env file (includes an explicit load of the above utility each time):

WD_OPEN_DWG,(if(not c:fix_me)(if(setq x(findfile "fix_me.lsp"))(load x)))(if c:fix_me (c:fix_me))

Let me know how it helps.


Thursday, November 20, 2008

Engineer To Order (ETO)

In these tough economic times it is more important now than ever to streamline the design process wherever possible.  I had the opportunity last week to see a presentation on Autodesk Inventor Automation Professional 2009 which helps to combine your "Engineering Rules" and 3D Inventor models into a very powerful Engineer to Order design tool.

Basically you use Inventor Automation to capture all of your design rules for a given product line such as a series of conveyors. Maybe one of the rules would be every 10 feet of conveyor there needs to be a motor, etc... Then after you have all of your design rules in place you can modify the front end GUI to get accurate configurations of these designs.

Using the GUI, your sales team, proposal engineers or anyone else in your organization can create accurate quotes on the fly in front of the customer with 3D models, and 2D documentation. This can also provide BOM information that will allow you to provide accurate pricing much earlier in the project.  Having the ability to do this will allow a company to bid jobs more accuratley and have more profitable business.

Autodesk Inventor Automation Professional 2009

Tuesday, August 01, 2006

Great Tips from Nate on Autolisp

Man, time flies when you are on the road. I just realized it has been a while since  I have posted anything. Unfortunatley I have been very swamped this past couple weeks with travel and a pretty big implementation project so my time has been limited. I did happen to notice that Nate Holt has put a couple Autolisp lessons on his blog site. You can view lesson 1 here. Lesson 1 goes over some basics on picking stuff and retrieving information from what you have selected. You can view lesson 2 here. Lesson 2 covers inserting blocks from the basic level. I hope that you all find this useful. I think Nate has done a great job of breaking it down to something easy to understand. Also look through nates blog he has posted Autlisp code for download on his site.

Question of the day.....

  • Has anyone used autolisp in the past as a way to automate some of the tasks they do every day.

Have a good day.