James Goldman
James Goldman

Reputation: 1

Pyautocad (Python in Autocad) defining existing objects in existing Autocad files

Is anyone familiar with pyautocad?(python for the automation of 2D drawings in Autocad). Is there a function which enables me to select/define existing objects (lines/circles etc) in an existing Autocad file? I want to automate some changes in an existing Autocad file (move/offset/mirror etc) and I need to select/define these existing objects before I can implement the move/offset/mirror pyautocad functions on them. This is unlike the case of working on a new Autocad folder, where I can define all my lines/circles when I create them. Thanks so much for your help! Really appreciate it. :)

Upvotes: 0

Views: 707

Answers (1)

ZhiroMurashka
ZhiroMurashka

Reputation: 1

To find an object in the autocad model, such a construction is used. In parentheses, you can specify a specific type of object to be found or several objects.

for obj in acad.iter_objects(['Circle', 'Line']):
    print(obj.ObjectName)

Upvotes: 0

Related Questions