Print Page | Close Window

vba - get objects property - VBA for LIST command

Printed From: CAD Forum
Category: EN
Forum Name: AutoCAD
Forum Description: Discussion about AutoCAD and AutoCAD LT, viewers, DWG and DWF formats, Design Review, AutoCAD 360, add-ons
URL: https://www.cadforum.cz/forum_en/forum_posts.asp?TID=9567
Printed Date: 23.Apr.2026 at 03:45


Topic: vba - get objects property - VBA for LIST command
Posted By: katto01
Subject: vba - get objects property - VBA for LIST command
Date Posted: 22.Aug.2013 at 17:20

Hello,

 

I am trying to get the properties of all objects in a drawing.

Something like using the LIST command in a loop for all objects.

Say I have 100 AcDbPolylines, and I need to extract the coordinates of the points for each of them for further calculations.

Interactively I would click on a polyline at a time, click list, and copy (by hand) the coordinates of the points.

I would like to use this process in VBA in a loop.

I did extensively searched for an answer to this question and found nothing.

Thank you




Replies:
Posted By: Kent Cooper
Date Posted: 22.Aug.2013 at 23:41
When you say "the properties of all objects," that's pretty wide open [most objects have a lot of properties].  But in the case of Polyline vertices, there are several ways to extract them, for example out of DXF-code-10 entries in the entity data, or from the VLA Coordinates property.  In what form do you need the vertex points once they've been extracted?  Collected into a Lisp list?  Written to a file, and if so, what kind?  And can they be merely listed, or do they need to be subdivided somehow, e.g. those of a particular Polyline grouped together separately from those of others?  And do they need to have X, Y and Z coordinates [for LWPolylines, neither source mentioned contains the Z coordinates with the X & Y of the vertex locations, so you'd need to add it from the Polyline's Elevation]?  More of an idea of how you would be using the information would help.



Print Page | Close Window