I suppose its the default way we currently handle it, will consider for the slient way, not only for this case, I think.
Thanks,
Amanda
I'll give this a +1. We would also like to see a silent drawing generation mode. Our drawing takes considerable time to update, and it would be nice if it could be done in the background, or silently.
For just in case: if you need to produce drawings referencing the similar contents, the IvTemplateDrawing might be handy. By Adopting the Inventor drawing file, the new Design with the ExternalReference Parameter in it will be created. As the ExternalReference is supplied, the whole drawing document is updated.
We distribute sample "TemplatedAssembly.iam" that demos the concept.
Hi Alex,
Regarding IvTemplateDrawing...Is there a way to ajust the view scale?
Child TheDrawing As :TemplateDrawing
ExternalReference = ThePart.memberPathName
ViewScale = ???
End Child
Regards,
Hi,
You have to edit the drawing template via Inventor API or manually, to change the view scale and lay out the drawing views.
Next time when Intent uses the IvTemplateDrawing Part that references the template, it will produce the resulting drawing based on these changes.
Alex,
Actually, I would like the view scale to adjust based on the model size. In this sample (TemplatedAssembly.iam) if you increase or decrease the OuterD value...the views are not size properly.
Regards,
Hi,
the C# code below changes the height of thePart and adjusts views scale based on thePart.Height . It is possible to add other part dimensions into consideration.
Please note that more factors you want to control on the Drawing, the most likely you need to use IvDrawingDocument.
The different way to approach the solution is to switch to the template with the "right" view scale
static void Test(IHostAPI addinModel, Inventor.Application ThisApplication) { IntentAPI api = Autodesk.Intent.IntentAPI.Instance; Part thePart = api.ActiveRoot["ThePart"]; double height = 30.0; thePart.SetRuleValue("height", height); Part theDrawing = api.ActiveRoot["TheDrawing"]; string templateFile = theDrawing["TemplateFile"]; DrawingDocument templateDrawing = ThisApplication.Documents.Open(templateFile) as DrawingDocument; foreach( DrawingView view in templateDrawing.Sheets[1].DrawingViews) { if( !view.ScaleFromBase) view.Scale = 100/height; // fugde factor. Depends on desired view W/H } using( new SilentOperation( ThisApplication)) { templateDrawing.Save(); templateDrawing.Close(); } } class SilentOperation : IDisposable { Inventor.Application _App; public SilentOperation(Inventor.Application app) { _App = app; _App.SilentOperation = true; } public void Dispose() { _App.SilentOperation = false; } }
Height = 30:
Height = 100.0;