Ask the Expert
Ask the Expert
Mark Douglas is the Assistant CAD Manager for MKM & Associates, a Residential & Commercial Structural Engineering company located in Santa Rosa, California USA. He specializes in AutoCAD Customization, Dynamic Blocks and all around general knowledge with AutoCAD 2000 through 2010 with more than 7 years of experience. He also uses DWF & Design Review to develop custom office applications for the engineering industry using VBA, AutoLISP & VB.NET. Mark, enjoys playing Ice hockey with friends, and watching his favorite NHL team the San Jose Sharks. Recently he's been contributing customization articles for Augi World magazine. Mark also enjoys holding yearly "What's new in AutoCAD" seminars for local architects in his home town to help them migrate to the next versions of AutoCAD. Mark is always looking to take MKM to the next level and utilizing new AutoCAD features each year helps him make that possible. View Mark's blog In the Dynamic Interface at http://mdouglas.blogs.com.
Company Information:
MKM & Associates is a Structural Engineering firm located in Santa Rosa,
CA, USA. www.mkmassociates.com. We have the experience and creativity to
find engineering solutions that work while taking "Green" products and
new Autodesk technologies to the next level."
Various Images created by Mark Douglas - Ask The Expert Session March 30th - April 3.
I want to write an application for autocad customization. for example i will just enter the length and width of a rectangle in a questioning window or a vb from and the ok button will give me a dwg of a rectangle. how is this possible and which type of programming language should i choose. also the application will be an exe which will run outside autocad?? please help
This is possible using a programming language like VB.net. You can get a free download here, http://www.microsoft.com/express/product/default.aspx or download your preferred language. Using VB.net you can build an exe so when a user clicks the OK button, it will launch AutoCAD (Either Visible or not your choice), draw the rectangle you want then close AutoCAD down saving the file. Itâs relatively simple. But the catch is you must have AutoCAD installed to draw the data. If you donât want to use âAutoCADâ you would need to license Autodesk âRealDWGâ (www.autodesk.com\realdwg) which will allow you to create DWGâs with no AutoCAD installed, however itâs a expensive.
In a dynamic Block within a field can you make it round to specific values? additionally can you make it so that it only shows inches instead of feet and inches?
Yes, to make a dynamic block round to specific values you would need to use a combination of a Lookup Table with a Range. Basically you would need to tell the parameter if you fall between these two values (1â & 4â) the lookup table will display the desired value for you. If you have a bunch of different values you need to round, you can only round up to the nearest inch. (3-1/8â would round to 4â) You can insert a Field into your attribute then suppress the leading zero in the additional format option inside the field editor. Iâve attached a block for you to see what both examples could look like. Hope this helps.
Do you intend to leverage the new parametric tools within AutoCAD 2010 and if so, what kind of content will you be creating first?
We do intend on leveraging the new parametric features, its just now where best to implement it. For our office a Structural Engineering firm, we see it helping in situations like Trusses always attached to edges of Roofs, Floor Joists attached to edges of foundation walls. Floor/Roof joists always in a horizontal or vertical direction in the drawing or even locking hangers or plates to ends of joists. Other instances are the symmetrical tool for rebar in foundations and the equal tool. The Auto Constrain button is nice if used correctly, and can really speed up some simple constraining operations. But its one of those tools you need to pay very close attention to when using. Creating parametric dynamic blocks would also be on my list of things to do, however, Iâve created a dynamic block here in our office for just about every possible thing, so im running short on ideas at the moment on what to create. But new blocks will be done via constraints in the block editor in the future.
where to find the vb.net tutorials for autocad. are they available online.
If you go to the url http://usa.autodesk.com/adsk/servlet/index?id=1911627&siteID=123112 you should see midway down the page a bold header âAutoCAD .NET Labs. This zip file has training material and sample files. You can also download the Object ARX zip file that has some .net samples hidden inside it. Looks like the Developer Network team has posted some âDev TVâ samples that walk you through on how to get started developing with AutoCAD .net. If you are looking for some hard copy references, I strongly recommend a book by Jerry Winters at VBCAD.com that has an AutoCAD .net Level 1 book. I have this book at my side when ever im coding AutoCAD for .net. Itâs the book I started from as well.
In a polyline I am able to enter a Global width of the true drawing unit distance and would like to do this for the line properties. Is there a way to do this and have it display as global width displays?
Unfortunately I donât believe this is possible using the actual line object and AutoCADâs internal command set. This might be possible through arx or .net coding to manipulate the line object? Or using some sort of workaround utilizing other combinations of stuff. If it was me, and I needed to apply a width to a selected set of lines, I would write a small lisp program like the one attached to select the lines, enter the width then convert each to a polyline and apply the width.
How to create an attribute for a tittle block having some tags like Project name, Dwg tittle, Company name...
Well attached is a sample block displaying attributes you described youâd like to have. Basically you need to create a block, if using AutoCAD 2006 or higher click the Open in Block editor button. Then use the ATTDEF command to insert an attribute tag into the block, naming each tag a different name, so there is no name conflicts, (Blocks donât like them the same). Then in the document tag insert a Field by right clicking in the default tag location and select Insert Field, go to document and that should automatically update as the document changes locations. If you go to the AutoCAD help there are better step by step instructions on how to create attributes but hopefully this gets you started.
Our business is planing to give some AutoCAD training to few of our people. One of the things we have to decide is if we should invest in learning Visual LISP or VBA. Which one is the more accurate for a small business as there is no more VBA editor included with Acad 2010? We are actually running on AutoCAD 2008 but planning to move up to 2010 in the next year.
My recommendation is definitely do not pursue the VBA route. For the exact reason you stated its not pre-installed anymore and who knows how much longer it will be a viable option to use inside AutoCAD. I donât program in VBA anymore as it all might one day need to be ported to .Net so im not wasting my time. I would say if there is no programming experience in your business, I suggest starting in Visual Lisp to get customization going in your office, then once you guys need more âHorse Powerâ and Visual Lisp canât do some things you want, I would look into using .Net for AutoCAD as you can pretty much do anything with it. There are tutorial links I posted a couple threads up here for you to get started from. Even though I code in .Net there are still many small programs I write directly in Lisp because its quick and easy. So a medium ground between both is good.
Do you know anything about the Lisp program Labcoor? Does it make a difference if you work with both imperial units and metric units? Our coordinates are not coming up with what is in the Properties of the drawing. We're working on a metric file.
I have not worked with Labcoor before so I can't say if it makes a difference. As well as very rarely do we work with metric units so coordinates arenât an issue for us in imperial units. Sorry I was not much help.
I CRETEDED A DETAIL BLOCK WITH ATTRIBUTES DETAIL NO. SHEET NO. SCALE. IS THERE ANY WAY WHAT EVER SCALE I INSERT IN MY ATTRIBUTE IT WILL BE USED TO SCALE THE BLOCK. LIKE IF I TYPE SCALE 1:10 IN MY ATTRIBUTE THE BLOCK SHOULD BE SCALED 10 TIMES. THANKS
I know what you are asking for but its not as simple as multiplying it by 10 times like you would hope. It you are using Annotation Scaling it is that easy, if your office uses annotation scaling let me know and I can get you a sample for that situation. Inside a dynamic block you can setup a scale action. What I did in the attached example is create your detail block at the 1:1 scale factor. (The scale you then would normally scale up 10 times). Now inside the block editor, you will see a linear parameter I have shown on the horizontal line. That will be our reference line. Scale the line up the 10 times from the one end point, then list the lineâs length. That is the value for your 1:10 scale. Now undo so the line goes back to 1:1 scale. Then times it by say 20 times, for the 1:20. Continue this for all scales and write them all down. Next place all these lengths of that line inside the lookup table, then reference the lookup table through a field in your scale attribute. This will allow you to pick your scale and the block will update, and show you the correct scale factor (Once you change scales you need to issue a REGEN to update the field.) This is the work around to get what you want, if you are using Annotation Scaling like I said none of this stuff is required. Hope this helps.
Have you heard of OpenDCL, I hear it makes customizing Acad with Lisp a breezeā¦
I have heard of OpenDCL, however Iâve never customized using it as I typically write form based programs in .Net. I have heard many success stories and seen some very nice applications written in it. Here is a link to a helpful site. www.opendcl.com
In Civil 3D my Mtext lockes up. I can't select it for editing. Whould you know how to overcome this problem. It is radom.
Iâve seen this issue as well. And like you said its sporadic. My suggestion is to ensure your graphics card is up to date with the latest and greatest drivers. Make sure you have the latest service pack for your Civil 3D and all hotfixâs. If you are running, 2010 version well you may need to wait it out until they develop a hotfix. Thatâs about all I can think of right now.
Benefits: