Its possible to "cast" SolidEdgeDocumentPtr to AssemblyDocumentPtr?

 

HI,

Its possible to "cast" SolidEdgeDocumentPtr to AssemblyDocumentPtr?

I tried

AssemblyDocumentPtr pAssembly ;

pAssembly = AssemblyDocumentPtr (pModel) ;

But i get alwas a null pointer.

Thanks in advance, best regards

Massimo

 

Posted by: Massimo Magris
Post date: 2/15/2009 4:22:57 AM

2 REPLIES

RE: Its possible to "cast" SolidEdgeDocumentPtr to AssemblyDocumentPtr?

HI,

 

yes, it's possible, I was casting a SyncAssemblyDocumentPtr.

 

but how to create a function that work either for AssemblyDocumentPtr and SyncAssemblyDocumentPtr.?

for example:

 

AssemblyDocumentPtr assembly1 ;

SyncAssemblyDocumentPtr assembly2 ;

 

CountSuppressedOccurrences (assembly1) ;

CountSuppressedOccurrences (assembly2) ;

..

..

int CountSuppressedOccurrences (????? pAssembly)

{

//This function should work for both type of Assemblies

 

}

 

 

 

 

Posted by: Massimo Magris
Post date: 2/15/2009 5:56:11 AM

RE: Its possible to "cast" SolidEdgeDocumentPtr to AssemblyDocumentPtr?

 

Hi Massimo,

 

you can do this with C++ templates. I haven't used these much and don't have a working example, but you should find something pretty easily in google. This should get you started but may not be 100% correct:template int CountSuppressedOccurrences(T pAssembly)

{

....

}

 

 

Cheers

Calum

 

Posted by: Calum McLellan
Post date: 2/15/2009 9:35:55 PM