Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

GetTemplateFile (COM C++)

5 REPLIES 5
Reply
Message 1 of 6
oransen
341 Views, 5 Replies

GetTemplateFile (COM C++)

What is the purpose of the 4th parameter in this call?

 

CComVariant pSubDocType;
CComBSTR sTemplate;

pInventorApp->GetTemplateFile (kPartDocumentObject, // We are creating a PartDocument 
                                        kDefaultSystemOfMeasure, // mm or inches?
                                        kDefault_DraftingStandard, 
                                        pSubDocType, 
                                        &sTemplate);

I've seen VB examples which pass a GUID, but here we just pass a pointer, and then don't use it, often.

 

 

 

 

5 REPLIES 5
Message 2 of 6
jdkriek
in reply to: oransen

The 4th parameter is DocumentSubType

 

Input constant (GUID) that specifies the subtype of the document to be created (sheet metal or weldment). 

 

Sub GetTemplateFile(DocumentType As DocumentTypeEnum, ByRef SystemOfMeasure As [defaultvalue(kDefaultSystemOfMeasure)] SystemOfMeasureEnum, ByRef DraftingStandard As [defaultvalue(kDefault_DraftingStandard)] DraftingStandardEnum, ByRef DocumentSubType As [optional] VARIANT, Result As [out, retval] BSTR)
Jonathan D. Kriek
MFG Solutions Engineer
KETIV Technologies, Inc.


Message 3 of 6
oransen
in reply to: jdkriek

My C++ code in the original post was taken from an example which I obviously and inevitably cannot find now!

 

Does anyone have an example in C++ of the correct use of GetTemplateFile?

 

 

Message 4 of 6
oransen
in reply to: oransen

It looks to me as if the GUID parameter only needs to be used in GetTemplateFile if you are dealing with Weldment or SheetMetal.

 

Could that be the reason why it can be left empty in all other circumstances?

 

 

Message 5 of 6
jdkriek
in reply to: oransen

Yes, it even says "optional" in the function 😉

Jonathan D. Kriek
MFG Solutions Engineer
KETIV Technologies, Inc.


Message 6 of 6
oransen
in reply to: jdkriek

It says optional In the VB function description maybe, but there's SFA info about the C++ call... (excuse my French) Smiley Wink

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report