Inventor Engineer-to-Order

Inventor Engineer-to-Order

Reply
Active Contributor
alundr
Posts: 52
Registered: ‎05-31-2012
Message 1 of 8 (288 Views)

create and close drawings

288 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?

Employee
amandamao
Posts: 71
Registered: ‎07-30-2008
Message 2 of 8 (242 Views)

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   

Mentor
bsee1
Posts: 212
Registered: ‎11-14-2011
Message 3 of 8 (233 Views)

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
Employee
AlexKorzun
Posts: 112
Registered: ‎11-10-2008
Message 4 of 8 (225 Views)

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
Autodesk Configurator 360 / Inventor ETO team
Autodesk, Inc.

Distinguished Contributor
ludesroc
Posts: 171
Registered: ‎05-03-2005
Message 5 of 8 (173 Views)

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
Employee
AlexKorzun
Posts: 112
Registered: ‎11-10-2008
Message 6 of 8 (167 Views)

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
Autodesk Configurator 360 / Inventor ETO team
Autodesk, Inc.

Distinguished Contributor
ludesroc
Posts: 171
Registered: ‎05-03-2005
Message 7 of 8 (162 Views)

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
Employee
AlexKorzun
Posts: 112
Registered: ‎11-10-2008
Message 8 of 8 (151 Views)

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
Autodesk Configurator 360 / Inventor ETO team
Autodesk, Inc.

Announcements
Manufacturing Community
The Manufacturing Community provides additional access to tips, tutorials, blogs and networking with peers.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.