Assign values to title block attributes programmatically

Assign values to title block attributes programmatically

jessemilio463
Participant Participant
324 Views
0 Replies
Message 1 of 1

Assign values to title block attributes programmatically

jessemilio463
Participant
Participant

I've tried to assign values to title block attributes of a drawing programmatically, but with no luck.
In the drawing there are several attributes created in the title block , but the Attributes collection get zero elements.
Anybody knows if it's possible with the current fusion 360 API development?

Ptr<Application> app;
Ptr<Document> ActiveDoc = app->activeDocument();
Ptr<Product> ActiveProd = app->activeProduct();
if (ActiveProd->productType()=="FusionDrawingProductType")
{Ptr<DrawingDocument> ActiveDrawDoc=(Ptr<DrawingDocument>)ActiveDoc;
Ptr<Drawing> ActiveDrawing=ActiveDrawDoc->drawing();
Ptr<Attributes> DrawAttribs=ActiveDrawing->attributes();
int Attribs_num=DrawAttribs->count(); //<--gets 0 attributes
Ptr<Attribute> Attrib1=ActiveDrawing->findAttributes("","ATTRIB1_TAG")[0];
Attrib1->value("57");//<-Value is not assigned
}

0 Likes
325 Views
0 Replies
Replies (0)