From f5ccad6bd0f39dda254157a699709a6e188b04ff Mon Sep 17 00:00:00 2001 From: Prashant Kumar Date: Sat, 17 Oct 2020 14:56:16 +0530 Subject: [PATCH] - fixed positioning of new attribute --- updateBOM_ITEM.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/updateBOM_ITEM.py b/updateBOM_ITEM.py index 172e42a..4727b29 100644 --- a/updateBOM_ITEM.py +++ b/updateBOM_ITEM.py @@ -50,9 +50,11 @@ def add_attribute(): acad = CreateObject("AutoCAD.Application", dynamic=True) doc = acad.ActiveDocument block = doc.Blocks.Item('BOM_ITEM') - insertion_point = array.array('d', [100.0, 100.0, 0.0]) - block.AddAttribute(2.0000, 1, 'New_Attribute_Test', - insertion_point, 'New_Attribute_Test', '1') + insertion_point = array.array('d', [4.0, 0.12500, 0.0]) + new_attr = block.AddAttribute(0.1, 1, 'WIDTH', + insertion_point, 'WIDTH', '1') + new_attr.Layer = 'BOM' + new_attr.ScaleFactor = 1 doc.Utility.Prompt("Adding new attribute\n") def process(doc): -- GitLab