• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    Autodesk Inventor Engineer-to-Order

    Reply
    Contributor
    Posts: 22
    Registered: ‎05-31-2012

    create and close drawings

    209 Views, 7 Replies
    11-13-2012 12:54 PM

    I am creating my drawings with ETO.  It correctly creates a drawing file and opens the file.  How do I create the drawing file without opening it?

    Please use plain text.
    Employee
    Posts: 62
    Registered: ‎07-30-2008

    Re: create and close drawings

    02-04-2013 10:05 PM in reply to: alundr

    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   

    Please use plain text.
    Mentor
    bsee1
    Posts: 172
    Registered: ‎11-14-2011

    Re: create and close drawings

    02-05-2013 08:32 AM in reply to: amandamao

    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.

    *****************************
    Win7 x64 - 16gb ram
    i7 3610qm
    FirePro M4000

    Inventor 2013
    ETO 6.1
    Please use plain text.
    Employee
    AlexKorzun
    Posts: 71
    Registered: ‎11-10-2008

    Re: create and close drawings

    02-05-2013 09:44 AM in reply to: bsee1

    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.

     

    Thank you,

    Alex Korzun
    Principal Engineer
    Inventor Engineer-to-Order
    Please use plain text.
    Distinguished Contributor
    ludesroc
    Posts: 131
    Registered: ‎05-03-2005

    Re: create and close drawings

    03-01-2013 08:21 AM in reply to: AlexKorzun

    Hi Alex,

     

    Regarding IvTemplateDrawing...Is there a way to ajust the view scale?

     

    Child TheDrawing As :TemplateDrawing
    ExternalReference = ThePart.memberPathName

    ViewScale = ???

    End Child

     

    Regards,

    Ludesroc
    Please use plain text.
    Employee
    AlexKorzun
    Posts: 71
    Registered: ‎11-10-2008

    Re: create and close drawings

    03-01-2013 08:43 AM in reply to: ludesroc

    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.

    Thank you,

    Alex Korzun
    Principal Engineer
    Inventor Engineer-to-Order
    Please use plain text.
    Distinguished Contributor
    ludesroc
    Posts: 131
    Registered: ‎05-03-2005

    Re: create and close drawings

    03-01-2013 08:57 AM in reply to: AlexKorzun

    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,

    Ludesroc
    Please use plain text.
    Employee
    AlexKorzun
    Posts: 71
    Registered: ‎11-10-2008

    Re: create and close drawings

    03-01-2013 10:38 AM in reply to: ludesroc

    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:

    1.jpg

     

    Height = 100.0;

    2.jpg

    Thank you,

    Alex Korzun
    Principal Engineer
    Inventor Engineer-to-Order
    Please use plain text.