<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Printing all drawings of an assembly file in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/3714776#M144911</link>
    <description>&lt;P&gt;Hi Invetnor users,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used &amp;nbsp;brendan.henderson's example as a base to create a Batch PDF rule for iLogic:&lt;/P&gt;&lt;P&gt;&lt;A href="http://forums.autodesk.com/t5/Autodesk-Inventor/Printing-drawing-sheet-sets-from-assembly-BOM-Parts-list/m-p/3714768#M455124" target="_blank"&gt;http://forums.autodesk.com/t5/Autodesk-Inventor/Printing-drawing-sheet-sets-from-assembly-BOM-Parts-list/m-p/3714768#M455124&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A href="http://inventortrenches.blogspot.com" target="_blank"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Nov 2012 19:14:04 GMT</pubDate>
    <dc:creator>Curtis_Waguespack</dc:creator>
    <dc:date>2012-11-28T19:14:04Z</dc:date>
    <item>
      <title>Printing all drawings of an assembly file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/2623539#M144881</link>
      <description>Hello everybody,&lt;BR /&gt;&lt;BR /&gt;
&lt;BR /&gt;&lt;BR /&gt;
I have written a program within Inventor that list all components of an assy with their properties (iproperties and properties from Producstream) and allow an export of the bill of material to Excel with our company layout.&lt;BR /&gt;&lt;BR /&gt;
&lt;BR /&gt;&lt;BR /&gt;
I want to add a function to my program in order to print all drawings that belong to an assy.&lt;BR /&gt;&lt;BR /&gt;
&lt;BR /&gt;&lt;BR /&gt;
I have the list of components and I want to use the new functionality of the Producstream menu that allows us to open the attached drawing.&lt;BR /&gt;&lt;BR /&gt;
&lt;BR /&gt;&lt;BR /&gt;
But I don’t know which library and which property.&lt;BR /&gt;&lt;BR /&gt;
&lt;BR /&gt;&lt;BR /&gt;
You have maybe another method??&lt;BR /&gt;&lt;BR /&gt;
&lt;BR /&gt;&lt;BR /&gt;
Thank you in advance&lt;BR /&gt;&lt;BR /&gt;
&lt;BR /&gt;&lt;BR /&gt;
Michel</description>
      <pubDate>Thu, 28 Jan 2010 08:29:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/2623539#M144881</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-01-28T08:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: Printing all drawings of an assembly file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/2623540#M144882</link>
      <description>&lt;P&gt;
I don't understand your statement:&lt;BR /&gt;
&lt;BR /&gt;
&lt;EM&gt;I have the list of components and I want to use the new functionality of the Producstream menu that allows us to open the attached drawing.&lt;BR /&gt;
&lt;BR /&gt;
&lt;/EM&gt;What new functionality? Are you talking about Productstream 2009 or Vault Manufacturing 2010?  What do you mean by "attached drawing"?  If the model is Inventor then the drawing is not technically an attachment in Productstream/Vault Manufacturing terminology.  Attachments are non-referencing documents (like AutoCAD, Excel, Word, etc).&lt;BR /&gt;
&lt;BR /&gt;
I'm guessing you want your custom application (the one you've attached an image of) to be able to download the associated drawing (idw) and print it.  Yes?
&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2010 13:47:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/2623540#M144882</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-01-28T13:47:20Z</dc:date>
    </item>
    <item>
      <title>Re: Printing all drawings of an assembly file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/2623541#M144883</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
You’re right; I’ve used the wrong word. You know maybe that French people are much better in French cuisine than in English.&lt;BR /&gt;
&lt;BR /&gt;
I will use an example:&lt;BR /&gt;
&lt;BR /&gt;
I have an .iam (let’s call it Mickey Mouse) composed of two .ipt (left ear and right ear) and one iam. (the body)&lt;BR /&gt;
&lt;BR /&gt;
I also have a drawing for each .ipt and each .iam . (Mickey Mouse.idw/left ear.idw/right ear.idw/body.idw)&lt;BR /&gt;
&lt;BR /&gt;
I want to use my program in order to print all the drawings that belong to Mickey Mouse.iam that is to say 4 drawings: Mickey Mouse.idw/left ear.idw/right ear.idw/body.idw&lt;BR /&gt;
&lt;BR /&gt;
I want to print each drawing on an automatic way.&lt;BR /&gt;
&lt;BR /&gt;
With the help of Autodesk, my program is still listing my 4 parts and assembly with theirs iproperties and properties from Productstream such as file path, personal part name…&lt;BR /&gt;
&lt;BR /&gt;
Productstream 2010 allows the opening of the .idw that is associated to one .ipt or .iam.&lt;BR /&gt;
&lt;BR /&gt;
If left ear.ipt is open and active, the button “Zeichnung öffnen” you can see in appendice will open left ear.idw.&lt;BR /&gt;
&lt;BR /&gt;
If I can use a loop to open each .iam and .ipt from my structured list of material, I will be able to use the same function as on top to open/print the associated drawings.&lt;BR /&gt;
&lt;BR /&gt;
Michel</description>
      <pubDate>Fri, 29 Jan 2010 06:36:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/2623541#M144883</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-01-29T06:36:58Z</dc:date>
    </item>
    <item>
      <title>Re: Printing all drawings of an assembly file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/2623542#M144884</link>
      <description>Hello everybody, &lt;BR /&gt;
&lt;BR /&gt;
I've tried with the function FindWhereUsed but it is very limited.&lt;BR /&gt;
&lt;BR /&gt;
Does anyone have another solution?&lt;BR /&gt;
&lt;BR /&gt;
Cordially...&lt;BR /&gt;
&lt;BR /&gt;
Michel</description>
      <pubDate>Tue, 02 Feb 2010 07:17:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/2623542#M144884</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-02-02T07:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: Printing all drawings of an assembly file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/2623543#M144885</link>
      <description>Hello&lt;BR /&gt;
&lt;BR /&gt;
Is your Application an AddIn or a Standalone? If it's a Standalone exe read on, otherwise - cut off the Apprentice part.&lt;BR /&gt;
If you got the complete Filepath in your Listing, you can use it. In my opinion the ProductStream function only searches for an idw with the same name as your actual active part or assembly. The search starts in the same directory, including subdirectories and goes on in the directories defined in your project. If my suggestion is right, you don't need this function. If Productstream stores the files in a directory and not in a database, try the following:&lt;BR /&gt;
Cut off the filetype in your String and add "idw", start an ApprenticeServer, open the document with your new created Filepath and print it. For more comfort, you could add a Form to control printing options.

Edited by: krieg on Feb 2, 2010 2:30 PM</description>
      <pubDate>Tue, 02 Feb 2010 14:28:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/2623543#M144885</guid>
      <dc:creator>Ralf_Krieg</dc:creator>
      <dc:date>2010-02-02T14:28:50Z</dc:date>
    </item>
    <item>
      <title>Re: Printing all drawings of an assembly file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/2623544#M144886</link>
      <description>Hello Krieg,&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
The fact is that Productstream stores the files with an incremented number in a specified directory (stored by year/month...and so on).&lt;BR /&gt;
&lt;BR /&gt;
Example: ENG-047034 for the .ipt (or .iam) and if I want to create the assossiated idw, Productstream will give the number ENG-047035 or any ENG-Number that does NOT exist. It's a database.&lt;BR /&gt;
&lt;BR /&gt;
The file path always look like this: \\Cad-server\Compass_Data\Daten\2010\02\0\ENG-047034.ipt but the file path of the assossiated idw will look like \\Cad-server\Compass_Data\Daten\2010\02\0\ENG-047035.idw.&lt;BR /&gt;
&lt;BR /&gt;
And I don't know how the link is created.&lt;BR /&gt;
&lt;BR /&gt;
Michel</description>
      <pubDate>Wed, 03 Feb 2010 06:35:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/2623544#M144886</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-02-03T06:35:29Z</dc:date>
    </item>
    <item>
      <title>Re: Printing all drawings of an assembly file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/2623545#M144887</link>
      <description>Hello&lt;BR /&gt;
&lt;BR /&gt;
Sorry, I missunderstood your question.&lt;BR /&gt;
I can't tell you anything about Productstream and Queries to it's database.&lt;BR /&gt;
&lt;BR /&gt;
The relation of an part or assembly to a drawing is, afaik, not stored in part/assembly. So you need to query the productstream database. The second way is to search through every drawing, if the referenced document is your part/assembly. Design assistent does it so. This could take a long time.</description>
      <pubDate>Wed, 03 Feb 2010 13:04:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/2623545#M144887</guid>
      <dc:creator>Ralf_Krieg</dc:creator>
      <dc:date>2010-02-03T13:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: Printing all drawings of an assembly file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/2623546#M144888</link>
      <description>Hello krieg,&lt;BR /&gt;
&lt;BR /&gt;
this is what I'm trying to do but I don't find the right Library.&lt;BR /&gt;
&lt;BR /&gt;
How can I find the right one?&lt;BR /&gt;
&lt;BR /&gt;
Michel</description>
      <pubDate>Wed, 03 Feb 2010 13:37:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/2623546#M144888</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-02-03T13:37:18Z</dc:date>
    </item>
    <item>
      <title>Re: Printing all drawings of an assembly file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/2623547#M144889</link>
      <description>I have done something like this. To find the corresponding drawing I used my own  method. Unfortunately the reference are reverse: a drawing references its part and not the other way around. So an idea would be to open all drawings invisible in the current directory and pick the one that references your part.</description>
      <pubDate>Wed, 03 Feb 2010 15:26:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/2623547#M144889</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-02-03T15:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: Printing all drawings of an assembly file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/2623548#M144890</link>
      <description>Hello afirmation,&lt;BR /&gt;
&lt;BR /&gt;
the fact is that Inventor propose a Producstream menu that allows to open the idw of an ipt directly (see picture in appendice). As it goes pretty fast, I don't think they open all drawings of the current directory. &lt;BR /&gt;
&lt;BR /&gt;
The idw can also be in an other directory than the ipt (If I start my .ipt in June and my .idw in July).&lt;BR /&gt;
&lt;BR /&gt;
I've tried to go through the ribbon but i can't find the right menu in VBA.&lt;BR /&gt;
&lt;BR /&gt;
I aggree with Krieg, I have to control Productsstream through Inventor (that is to say : to find the right library) in order to list all the documents where my ipt/iam is used in.&lt;BR /&gt;
&lt;BR /&gt;
Michel</description>
      <pubDate>Wed, 03 Feb 2010 15:38:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/2623548#M144890</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-02-03T15:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: Printing all drawings of an assembly file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/2623549#M144891</link>
      <description>Well I think inventor still has a problem because if the drawing does not have the exact name as the part, it fails in finding the drawing.&lt;BR /&gt;
&lt;BR /&gt;
The command that Inventor uses to open the corresponding drawing document is "CMxOpenDrawingCmd". To use it to open the drawing for a given part use it like this:&lt;BR /&gt;
   &lt;BR /&gt;
inventorApp.CommandManager.PostPrivateEvent(Inventor.PrivateEventTypeEnum.kFileNameEvent, fileName);&lt;BR /&gt;
inventorApp.CommandManager.ControlDefinitions["CMxOpenDrawingCmd"].Execute()</description>
      <pubDate>Wed, 03 Feb 2010 16:05:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/2623549#M144891</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-02-03T16:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: Printing all drawings of an assembly file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/2623550#M144892</link>
      <description>First I know nothing about Productstream.&lt;BR /&gt;
&lt;BR /&gt;
You can call the button command. like this&lt;BR /&gt;
&lt;BR /&gt;
Dim oControlDef As ControlDefinition&lt;BR /&gt;
Set oControlDef =&lt;BR /&gt;
ThisApplication.CommandManager.ControlDefinitions.Item("ScxEditTextCmd")&lt;BR /&gt;
oControlDef.Execute&lt;BR /&gt;
&lt;BR /&gt;
To get Command name of the button &lt;BR /&gt;
Private Sub UserInpEvts_OnActivateCommand(ByVal CommandName As String, ByVal Context As Inventor.NameValueMap) Handles UserInpEvts.OnActivateCommand&lt;BR /&gt;
           msgbox CommandName &lt;BR /&gt;
 End sub&lt;BR /&gt;
          &lt;BR /&gt;
Use the Event Handlers OnOpenDocument&lt;BR /&gt;
to check when the drawing is open.&lt;BR /&gt;
&lt;BR /&gt;
René J</description>
      <pubDate>Wed, 03 Feb 2010 16:15:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/2623550#M144892</guid>
      <dc:creator>Rene-J</dc:creator>
      <dc:date>2010-02-03T16:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: Printing all drawings of an assembly file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/2623551#M144893</link>
      <description>&lt;P&gt;
Does your program copy locally, all required files from Productstream based on a parent document or part number?  Or does it expect the files to be already local, meaning your program analyzes the structure of the active document ans attampts to locate and print the associated drawings?  If you need Productstream to copy the files locally then you'll need to learn some of Productstream's API.  Doug Redmon has a site that can offer some insite: &lt;A href="http://justonesandzeros.typepad.com/blog/"&gt;http://justonesandzeros.typepad.com/blog/&lt;/A&gt;.  Do you use ECOs and Items in Productstream?  If so, are you concerned with printing the latest version or a specific released revsion?&lt;BR /&gt;
&lt;BR /&gt;
Do you know what Apprentice is?  It is an interfaceless version (mostly read-only - except file properties, file references and a few things).  I personally would use Apprentice's API (instead of Inventor's API) to do the printing.  It's faster (no GUI) and you can print drawings without the model references if error trapped correctly.  In Inventor's API help, review ApprenticeServer, ApprenticeServerDocument (assembly structure), ApprenticeServerDrawingDocument and ApprenticeDrawingPrintManager.
&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2010 17:22:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/2623551#M144893</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-02-03T17:22:11Z</dc:date>
    </item>
    <item>
      <title>Re: Printing all drawings of an assembly file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/2623552#M144894</link>
      <description>Hello&lt;BR /&gt;
&lt;BR /&gt;
I've found a paper of Autodesk university 2007 under http://augiru.augi.com/content/library/au07/data/paper/DE305-4.pdf about customizing Vault/Productstream. Maybe it helps you getting started. The second step is to take a look at the SDK in “C:\Program Files\Autodesk\DataManagement Server 20xx. There's the complete Documentation and Samples.

Edited by: krieg on Feb 3, 2010 6:42 PM</description>
      <pubDate>Wed, 03 Feb 2010 18:41:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/2623552#M144894</guid>
      <dc:creator>Ralf_Krieg</dc:creator>
      <dc:date>2010-02-03T18:41:27Z</dc:date>
    </item>
    <item>
      <title>Re: Printing all drawings of an assembly file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/2623553#M144895</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
I’ve tried what you (afirmation) proposed me (VBA):&lt;BR /&gt;
&lt;BR /&gt;
FileName = ThisApplication.ActiveDocument.FullFileName&lt;BR /&gt;
Call ThisApplication.CommandManager.PostPrivateEvent(Inventor.PrivateEventTypeEnum.kFileNameEvent, FileName)&lt;BR /&gt;
ThisApplication.CommandManager.ControlDefinitions.Item("CMxOpenDrawingCmd").Execute&lt;BR /&gt;
&lt;BR /&gt;
I’ve no compilation problem but it does not execute anything.&lt;BR /&gt;
On a normal way, using mouse and fingers, the associated .idw gets open.&lt;BR /&gt;
I’ve tried different things till now without success.&lt;BR /&gt;
&lt;BR /&gt;
I just reedit the thread to thank you all for your helpful message. I feel I'm very close to what I'm looking for.&lt;BR /&gt;
&lt;BR /&gt;
Michel

Edited by: Michel.Brun on Feb 4, 2010 12:31 PM</description>
      <pubDate>Thu, 04 Feb 2010 12:30:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/2623553#M144895</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-02-04T12:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: Printing all drawings of an assembly file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/2623554#M144896</link>
      <description>I did not try it myself but I was hoping it would work.  I'll send you a feedback after I look into it.</description>
      <pubDate>Thu, 04 Feb 2010 13:02:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/2623554#M144896</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-02-04T13:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: Printing all drawings of an assembly file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/2623555#M144897</link>
      <description>Yes it was too easy to be true. The reason is that the command does not work for a given file name, but for the current browser selection. So the PostPrivateEvent used to sent the file name to the command is now useless. &lt;BR /&gt;
&lt;BR /&gt;
The first thing that comes into my mind and which I tested that works is to select the wanted file in browser and then call "CMxOpenDrawingCmd". To select a node in browser you can do it as below. If it is an assembly you can select a document occurrence like this:&lt;BR /&gt;
&lt;BR /&gt;
Inventor.ComponentOccurrencesEnumerator enumOcc = assemblyDoc.ComponentDefinition.Occurrences.get_AllReferencedOccurrences(doc);&lt;BR /&gt;
assemblyDoc.SelectSet.Clear();&lt;BR /&gt;
assemblyDoc.SelectSet.Select(enumOcc[1]);&lt;BR /&gt;
&lt;BR /&gt;
if it is exactly the root assembly like this:&lt;BR /&gt;
assemblyDoc.SelectSet.Clear();&lt;BR /&gt;
assemblyDoc.SelectSet.Select(assemblyDoc.ComponentDefinition);&lt;BR /&gt;
&lt;BR /&gt;
After that just call the command with: CommandManager.ControlDefinitions["CMxOpenDrawingCmd"].Execute()&lt;BR /&gt;
&lt;BR /&gt;
These should work but I do not know if it is the best way.</description>
      <pubDate>Thu, 04 Feb 2010 13:50:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/2623555#M144897</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-02-04T13:50:39Z</dc:date>
    </item>
    <item>
      <title>Re: Printing all drawings of an assembly file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/2623556#M144898</link>
      <description>Hello, what a nice day today,&lt;BR /&gt;
&lt;BR /&gt;
I have found the right command (see below)&lt;BR /&gt;
&lt;BR /&gt;
    ' Get the CommandManager object.&lt;BR /&gt;
    Dim oCommandMgr As CommandManager&lt;BR /&gt;
    Set oCommandMgr = ThisApplication.CommandManager&lt;BR /&gt;
&lt;BR /&gt;
    ' Get control definition for the line command.&lt;BR /&gt;
    Dim oControlDef As ControlDefinition&lt;BR /&gt;
    Set oControlDef = oCommandMgr.ControlDefinitions.Item("&lt;B&gt;AIMDOpenDrawingInContextMenuInternal&lt;/B&gt;")&lt;BR /&gt;
    'Set oControlDef = oCommandMgr.ControlDefinitions.Item("AIMDOpenDrawingInternal")&lt;BR /&gt;
  &lt;BR /&gt;
    ' Execute the command.&lt;BR /&gt;
    Call oControlDef.Execute&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
I will now do a loop to open all occurences and I will print all the drawings that are associated to my occurences. I will put it later on that thread.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
But how can I get the vbExclamation message that I get when there are no associated Drawing to my occurence. See attached file.&lt;BR /&gt;
&lt;BR /&gt;
I've tried with Displayalert so as Excel and an On Error routine but the line is already Call oControlDef.Execute&lt;BR /&gt;
read.&lt;BR /&gt;
&lt;BR /&gt;
I know that it's not the better way and I agree with cadfish1. I will try it with apprentice as soon as it will works with the first solution. But I first have to check how to command Productstream through Inventor.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Michel

Edited by: Michel.Brun on Feb 5, 2010 11:11 AM</description>
      <pubDate>Fri, 05 Feb 2010 09:23:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/2623556#M144898</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-02-05T09:23:59Z</dc:date>
    </item>
    <item>
      <title>Re: Printing all drawings of an assembly file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/2623557#M144899</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
here's my code.... I hope it will help somebody else...&lt;BR /&gt;
Cordialy &lt;BR /&gt;
Michel&lt;BR /&gt;
&lt;BR /&gt;
Keywords: Batch plot, All drawings plot, Printing all drawings, Print all drawings, associated drawings&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
If MsgBox("Are you sure?", vbYesNo) = vbYes Then&lt;BR /&gt;
&lt;BR /&gt;
        'Opening all associated parts&lt;BR /&gt;
    &lt;BR /&gt;
        'Get the active assembly.&lt;BR /&gt;
        Dim oAsmDoc As AssemblyDocument&lt;BR /&gt;
        Set oAsmDoc = ThisApplication.ActiveDocument&lt;BR /&gt;
    &lt;BR /&gt;
        'Get all of the referenced documents.&lt;BR /&gt;
        Dim oRefDocs As DocumentsEnumerator&lt;BR /&gt;
        Set oRefDocs = oAsmDoc.AllReferencedDocuments&lt;BR /&gt;
    &lt;BR /&gt;
        'Iterate through the list of documents.&lt;BR /&gt;
        Dim oRefDoc As Document&lt;BR /&gt;
        &lt;BR /&gt;
        For Each oRefDoc In oRefDocs&lt;BR /&gt;
            &lt;BR /&gt;
            'Debug.Print oRefDoc.FullFileName&lt;BR /&gt;
            &lt;BR /&gt;
        'Open iam or ipt&lt;BR /&gt;
            Dim oDoc As Document&lt;BR /&gt;
            Set oDoc = ThisApplication.Documents.Open(oRefDoc.FullFileName, True)&lt;BR /&gt;
        &lt;BR /&gt;
        'Get the CommandManager object&lt;BR /&gt;
            Dim oCommandMgr As CommandManager&lt;BR /&gt;
            Set oCommandMgr = ThisApplication.CommandManager&lt;BR /&gt;
        &lt;BR /&gt;
        'Get control definition for the line command&lt;BR /&gt;
            Dim oControlDef As ControlDefinition&lt;BR /&gt;
            Set oControlDef = oCommandMgr.ControlDefinitions.Item("AIMDOpenDrawingInContextMenuInternal")&lt;BR /&gt;
          &lt;BR /&gt;
        'Execute the command&lt;BR /&gt;
            Call oControlDef.Execute&lt;BR /&gt;
        &lt;BR /&gt;
        'Print idw&lt;BR /&gt;
            If ThisApplication.ActiveDocument.DocumentType = kDrawingDocumentObject Then&lt;BR /&gt;
            &lt;BR /&gt;
                Dim oDraw As Document&lt;BR /&gt;
                Set oDraw = ThisApplication.ActiveDocument&lt;BR /&gt;
    &lt;BR /&gt;
                'MsgBox oDraw.FullFileName&lt;BR /&gt;
    &lt;BR /&gt;
                Dim oDrgPrintMgr As DrawingPrintManager&lt;BR /&gt;
                Set oDrgPrintMgr = oDraw.PrintManager&lt;BR /&gt;
                'Set the printer name&lt;BR /&gt;
                'oDrgPrintMgr.Printer = "XXXXXXX"&lt;BR /&gt;
            &lt;BR /&gt;
                oDrgPrintMgr.PrintRange = kPrintAllSheets&lt;BR /&gt;
                &lt;BR /&gt;
                'Set the paper size and scale&lt;BR /&gt;
                On Error Resume Next&lt;BR /&gt;
                &lt;BR /&gt;
                Select Case oDraw.ActiveSheet.Size&lt;BR /&gt;
                    Case kA4DrawingSheetSize&lt;BR /&gt;
                        oDrgPrintMgr.PaperSize = kPaperSizeA4&lt;BR /&gt;
                        oDrgPrintMgr.ScaleMode = kPrintCustomScale&lt;BR /&gt;
                        oDrgPrintMgr.[Scale] = 1&lt;BR /&gt;
                    Case kA3DrawingSheetSize&lt;BR /&gt;
                        oDrgPrintMgr.PaperSize = kPaperSizeA4&lt;BR /&gt;
                        oDrgPrintMgr.ScaleMode = kPrintBestFitScale&lt;BR /&gt;
                    Case kA2DrawingSheetSize&lt;BR /&gt;
                        oDrgPrintMgr.PaperSize = kPaperSizeA3&lt;BR /&gt;
                        oDrgPrintMgr.ScaleMode = kPrintBestFitScale&lt;BR /&gt;
                    Case kA1DrawingSheetSize&lt;BR /&gt;
                        oDrgPrintMgr.PaperSize = kPaperSizeA3&lt;BR /&gt;
                        oDrgPrintMgr.ScaleMode = kPrintBestFitScale&lt;BR /&gt;
                    Case kA0DrawingSheetSize&lt;BR /&gt;
                        oDrgPrintMgr.PaperSize = kPaperSizeA3&lt;BR /&gt;
                        oDrgPrintMgr.ScaleMode = kPrintBestFitScale&lt;BR /&gt;
                    Case Else&lt;BR /&gt;
                &lt;BR /&gt;
                'Debug.Print "ungültiges Papierformat"&lt;BR /&gt;
                &lt;BR /&gt;
                End Select&lt;BR /&gt;
            &lt;BR /&gt;
                'Set the paper orientation&lt;BR /&gt;
                On Error Resume Next&lt;BR /&gt;
                &lt;BR /&gt;
                Select Case oDraw.ActiveSheet.Orientation&lt;BR /&gt;
                    Case kLandscapePageOrientation&lt;BR /&gt;
                        oDrgPrintMgr.Orientation = kLandscapeOrientation&lt;BR /&gt;
                    Case kPortraitPageOrientation&lt;BR /&gt;
                        oDrgPrintMgr.Orientation = kPortraitOrientation&lt;BR /&gt;
                    Case Else&lt;BR /&gt;
                        &lt;BR /&gt;
                'Debug.Print "ungültige Orientierung"&lt;BR /&gt;
                &lt;BR /&gt;
                End Select&lt;BR /&gt;
                &lt;BR /&gt;
                oDrgPrintMgr.SubmitPrint&lt;BR /&gt;
    &lt;BR /&gt;
            'Close idw&lt;BR /&gt;
                oDraw.Close (True)&lt;BR /&gt;
                &lt;BR /&gt;
            End If&lt;BR /&gt;
    &lt;BR /&gt;
        'Close iam or ipt&lt;BR /&gt;
            oDoc.Close (True)&lt;BR /&gt;
    &lt;BR /&gt;
        Next&lt;BR /&gt;
&lt;BR /&gt;
        'Opening Asmdrawing in context menu&lt;BR /&gt;
        &lt;BR /&gt;
        Call oControlDef.Execute&lt;BR /&gt;
            &lt;BR /&gt;
        Set oDraw = ThisApplication.ActiveDocument&lt;BR /&gt;
        &lt;BR /&gt;
        'MsgBox oDraw.FullFileName&lt;BR /&gt;
        &lt;BR /&gt;
        'Dim oDrgPrintMgr As DrawingPrintManager&lt;BR /&gt;
        Set oDrgPrintMgr = oDraw.PrintManager&lt;BR /&gt;
        'Set the printer name&lt;BR /&gt;
        'oDrgPrintMgr.Printer = "XXXXXXX"&lt;BR /&gt;
                &lt;BR /&gt;
        oDrgPrintMgr.PrintRange = kPrintAllSheets&lt;BR /&gt;
                    &lt;BR /&gt;
        'Set the paper size and scale&lt;BR /&gt;
        On Error Resume Next&lt;BR /&gt;
                    &lt;BR /&gt;
        Select Case oDraw.ActiveSheet.Size&lt;BR /&gt;
            Case kA4DrawingSheetSize&lt;BR /&gt;
                oDrgPrintMgr.PaperSize = kPaperSizeA4&lt;BR /&gt;
                oDrgPrintMgr.ScaleMode = kPrintCustomScale&lt;BR /&gt;
                oDrgPrintMgr.[Scale] = 1&lt;BR /&gt;
            Case kA3DrawingSheetSize&lt;BR /&gt;
                oDrgPrintMgr.PaperSize = kPaperSizeA4&lt;BR /&gt;
                oDrgPrintMgr.ScaleMode = kPrintBestFitScale&lt;BR /&gt;
            Case kA2DrawingSheetSize&lt;BR /&gt;
                oDrgPrintMgr.PaperSize = kPaperSizeA3&lt;BR /&gt;
                oDrgPrintMgr.ScaleMode = kPrintBestFitScale&lt;BR /&gt;
            Case kA1DrawingSheetSize&lt;BR /&gt;
                oDrgPrintMgr.PaperSize = kPaperSizeA3&lt;BR /&gt;
                oDrgPrintMgr.ScaleMode = kPrintBestFitScale&lt;BR /&gt;
            Case kA0DrawingSheetSize&lt;BR /&gt;
                oDrgPrintMgr.PaperSize = kPaperSizeA3&lt;BR /&gt;
                oDrgPrintMgr.ScaleMode = kPrintBestFitScale&lt;BR /&gt;
            Case Else&lt;BR /&gt;
                    &lt;BR /&gt;
        'Debug.Print "ungültiges Papierformat"&lt;BR /&gt;
                    &lt;BR /&gt;
        End Select&lt;BR /&gt;
                &lt;BR /&gt;
        'Set the paper orientation&lt;BR /&gt;
        On Error Resume Next&lt;BR /&gt;
                    &lt;BR /&gt;
        Select Case oDraw.ActiveSheet.Orientation&lt;BR /&gt;
            Case kLandscapePageOrientation&lt;BR /&gt;
                oDrgPrintMgr.Orientation = kLandscapeOrientation&lt;BR /&gt;
            Case kPortraitPageOrientation&lt;BR /&gt;
                oDrgPrintMgr.Orientation = kPortraitOrientation&lt;BR /&gt;
            Case Else&lt;BR /&gt;
                            &lt;BR /&gt;
        'Debug.Print "ungültige Orientierung"&lt;BR /&gt;
                    &lt;BR /&gt;
        End Select&lt;BR /&gt;
                    &lt;BR /&gt;
        oDrgPrintMgr.SubmitPrint&lt;BR /&gt;
        &lt;BR /&gt;
        'Close idw&lt;BR /&gt;
        oDraw.Close (True)&lt;BR /&gt;
&lt;BR /&gt;
    Else&lt;BR /&gt;
    &lt;BR /&gt;
        'No&lt;BR /&gt;
&lt;BR /&gt;
End If</description>
      <pubDate>Mon, 08 Feb 2010 12:14:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/2623557#M144899</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-02-08T12:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: Printing all drawings of an assembly file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/3078618#M144900</link>
      <description>&lt;P&gt;Found&amp;nbsp;this code and I was trying to get it to work.&amp;nbsp; Get an error when I run it.&amp;nbsp;&amp;nbsp;I copied/pasted it into the Inventor VB editor and then edited it a little.... added this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG height="179" src="http://forums.autodesk.com/t5/image/serverpage/image-id/10066i89781140422F4078/image-size/original?v=mpbl-1&amp;amp;px=-1" width="530" align="center" alt="2011-07-01_0803.png" title="2011-07-01_0803.png" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, In Inventor, I open an assembly that has three parts to it.&amp;nbsp; All the parts have idws associated to them and they are stored locally.&amp;nbsp; When I run the code I get this error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG height="141" src="http://forums.autodesk.com/t5/image/serverpage/image-id/10068i9D3CC0C46720EB85/image-size/original?v=mpbl-1&amp;amp;px=-1" width="585" align="center" alt="2011-07-01_0801_001.png" title="2011-07-01_0801_001.png" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone point me in the right direction as to what I'm doing wrong.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2011 13:10:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/printing-all-drawings-of-an-assembly-file/m-p/3078618#M144900</guid>
      <dc:creator>karthur1</dc:creator>
      <dc:date>2011-07-01T13:10:14Z</dc:date>
    </item>
  </channel>
</rss>

