Assign values to title block attributes programmatically
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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
}