TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: DanB on April 04, 2005, 12:37:32 PM

Title: "Assoc" #'s
Post by: DanB on April 04, 2005, 12:37:32 PM
Here's a snipet of code from another post here on the forums..(Thanks CAB)
Code: [Select]

   ((= (cdr (assoc 0 (entget ename))) "ARC")
         (prompt "\nObject is an Arc, Try again.")


Is there any sort of list out there that breakdowns what each "assoc" relates too? (i.e. in the above example, assoc 0 relates to the object type being an "arc") I know you are able to extract such things as start and end or center point from the "assoc" values, maybe someone can help expand on this?
Title: "Assoc" #'s
Post by: MP on April 04, 2005, 12:44:11 PM
Try this. (http://www.autodesk.com/techpubs/autocad/acad2000/dxf/index.htm) For example, this (http://www.autodesk.com/techpubs/autocad/acad2000/dxf/arc_dxf_06.htm).

You may also wish to explore the activex side of visual lisp, more illuminating. For example, this:

Code: [Select]
(if (setq ename (car (entsel)))
   (vlax-dump-object (vlax-ename->vla-object ename) t)
)

Might spew this:
Code: [Select]
; IAcadArc: AutoCAD Arc Interface
; Property values:
;   Application (RO) = #<VLA-OBJECT IAcadApplication 00b07a68>
;   ArcLength (RO) = 146.28
;   Area (RO) = 3066.1
;   Center = (167.938 96.935 0.0)
;   Color = 256
;   Document (RO) = #<VLA-OBJECT IAcadDocument 010c7e1c>
;   EndAngle = 2.39046
;   EndPoint (RO) = (119.035 142.597 0.0)
;   Handle (RO) = "2B"
;   HasExtensionDictionary (RO) = 0
;   Hyperlinks (RO) = #<VLA-OBJECT IAcadHyperlinks 0114ca64>
;   Layer = "0"
;   Linetype = "ByLayer"
;   LinetypeScale = 1.0
;   Lineweight = -1
;   Normal = (0.0 0.0 1.0)
;   ObjectID (RO) = 1074253144
;   ObjectName (RO) = "AcDbArc"
;   OwnerID (RO) = 1074253048
;   PlotStyleName = "ByLayer"
;   Radius = 66.9071
;   StartAngle = 0.20414
;   StartPoint (RO) = (233.456 110.499 0.0)
;   Thickness = 0.0
;   TotalAngle (RO) = 2.18632
;   Visible = -1
; Methods supported:
;   ArrayPolar (3)
;   ArrayRectangular (6)
;   Copy ()
;   Delete ()
;   GetBoundingBox (2)
;   GetExtensionDictionary ()
;   GetXData (3)
;   Highlight (1)
;   IntersectWith (2)
;   Mirror (2)
;   Mirror3D (3)
;   Move (2)
;   Offset (1)
;   Rotate (2)
;   Rotate3D (3)
;   ScaleEntity (2)
;   SetXData (2)
;   TransformBy (1)
;   Update ()
Title: "Assoc" #'s
Post by: daron on April 04, 2005, 01:26:27 PM
or some dxf style dumping would be:
Code: [Select]
(entget (car entsel "\nSelect an object to dump: ")))
You can set it to a function yourself and add any error trapping you want.
Title: "Assoc" #'s
Post by: MP on April 04, 2005, 01:52:38 PM
This tool (http://www.theswamp.org/lilly.pond/puckett/lisp/info.zip) might prove helpful as you learn dxf codes and activex properties.
Title: "Assoc" #'s
Post by: MP on April 04, 2005, 02:06:51 PM
Update dxf references(s). (http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=5129239)
Title: "Assoc" #'s
Post by: DanB on April 05, 2005, 07:40:22 AM
Haven't tried the "tool" yet but thanks for sharing all of this information. I just downloaded the PDF references, appreciate all the feedback guys.

Dan
Title: "Assoc" #'s
Post by: CAB on April 05, 2005, 08:19:49 AM
MP

Those are some great links.

Thanks
Title: "Assoc" #'s
Post by: MP on April 14, 2005, 10:48:42 AM
Thanks Charles (didn't see this post).