newtocad Posted February 10, 2017 Posted February 10, 2017 Hi all, I have done data extraction of my CAD file to excel using AutoCad 2017 (full version), which includes global width, but did not include the handle or any other type of ID to distinguish the lines from one another. Is there any way to get the attributes of lines, specifically global width, in an attribute table that includes the handle to distinguish the lines? If this can be accomplished in other cad software that is free besides Autocad, I'm open to that as well Thanks! Quote
BIGAL Posted February 10, 2017 Posted February 10, 2017 You can get at just about any property using lisp, including id of object "handle". This is an example Select object: ; IAcadLine: AutoCAD Line Interface ; Property values: ; Angle (RO) = 0.0 ; Application (RO) = #<VLA-OBJECT IAcadApplication 000000013fb63f10> ; Delta (RO) = (197.294 0.0 0.0) ; Document (RO) = #<VLA-OBJECT IAcadDocument 000000005cb8bd28> ; EndPoint = (507.617 210.352 0.0) ; EntityTransparency = "ByLayer" ; Handle (RO) = "12A8D" ; HasExtensionDictionary (RO) = 0 ; Hyperlinks (RO) = #<VLA-OBJECT IAcadHyperlinks 0000000054647f18> ; Layer = "DEFAULT" ; Length (RO) = 197.294 ; Linetype = "ByLayer" ; LinetypeScale = 1.0 ; Lineweight = -1 ; Material = "ByLayer" ; Normal = (0.0 0.0 1.0) ; ObjectID (RO) = 62 ; ObjectName (RO) = "AcDbLine" ; OwnerID (RO) = 61 ; PlotStyleName = "ByLayer" ; StartPoint = (310.323 210.352 0.0) ; Thickness = 0.0 ; TrueColor = #<VLA-OBJECT IAcadAcCmColor 000000005465b530> ; Visible = -1 a sample for you copy the lines 1 at a time to command line (setq obj (vlax-ename->vla-object (car (entsel "\nPick Line")))) (alert (strcat "Object id is " (vla-get-handle obj))) Quote
newtocad Posted February 10, 2017 Author Posted February 10, 2017 Thanks for the help! Maybe I'm not understanding the code that well or how to use it exactly in my case. Maybe I wasn't super clear either. What I'm really trying to accomplish is an easy way to take all the lines easily (or just of type polyline works as well) for any CAD file and get them in a text or excel table (with handle and global width being the only fields we need). This would allow us to get the global width for our lines into the GIS software we use (ArcMap), which doesn't include global width in the attribute table when it brings in a CAD file, in case you were curious on the background. Quote
BIGAL Posted February 11, 2017 Posted February 11, 2017 Are you exporting a SHP file to ARCMAP you may be able to include the line width. I am no expert with regards SHP file export. Bringing in a cad file is different a SHP file can have a heap of extra info attached to an object. A simple example a Contour pline will have the height as an attribute. Murphmap help maybe ? Quote
newtocad Posted February 11, 2017 Author Posted February 11, 2017 It was a CAD file. We take them into arcmap and convert them into other file format's. I found another solution to the problem that works better for us. I found a tool in Lisp that will make an outline of the width with polylines and that works perfectly for us. Now we don't even have to buffer (which is what I had wanted the global width for). Thanks again for all the help! Quote
newtocad Posted February 14, 2017 Author Posted February 14, 2017 Forgot to include the link to the lisp tool that I found: http://cadtips.cadalyst.com/linear-objects/polyline-outline Maybe it will help someone in the future Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.