


This method creates an AutoCAD Block object instance for the block that I pass as an input parameter value. This is when I use the InsertBlock method. Now that I have created blocks I want to use them in my drawing. Creating instances with InsertBlock()-method in pyautocad

Likewise, I can do the same for Blocks collectively in the form of a Blocks Collection object. I can save multiple AutoCAD Block objects in the Document database. I have explained how this Document object works in one of my previous articles. Once I create a AutoCAD Block object with the pyautocad module in Python, it gets saved in the Document database. That one block object can contain multiple other objects with e.g. Whenever I want to use certain objects repeatedly, I create a block for those objects. Creating AutoCAD Block objects in Pythonįirstly, let me explain why AutoCAD Block objects are so significant. More precisely, I am specifically referring to pythoncom and win32com. I have explained how to use communication modules in Python in previous blog posts. In this article I elaborate on Block objects in AutoCAD and how working with them can be automatized using Python.Īlthough for this practical example I am using the pyautocad library I can also use pythoncom.
