Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Active View Size from Drafting Workbench using CAA. 1

Status
Not open for further replies.

SKimi

Mechanical
Feb 27, 2020
28
IN
Hi,
Can anyone tell me , how do i get size of active view in the Drafting workbench using CAA ?

I have tried few ways but was not able to get the view size. Please let me know.

Thanks in advance !!
 
Replies continue below

Recommended for you

Hi Cthulhu,

Thanks for the reply. I have already tried something like this:

//Example :
//CATIADrawingView piVBViewObj

"
CATSafeArrayVariant oValue;
piVBViewObj->Size(oValue);
"
But i do not get any output. Please correct me if an wrong , as am trying it for the first time.

Thanks in advance[bigsmile]
 
You have to init array first. It can be done with BuildSafeArray, although I may've misspelled function name.
 
Thanks for the reply.

But could you please elaborate on this, because i have tried init array yet i see no value.
 
Well, it's time to post your code.

It should go like:
Code:
#include "CATAutoConversions.h"

double coords[4];
CATSafeArrayVariant* arr = BuildSafeArrayVariant(coords, 4);
piVBViewObj->Size(*arr);
delete arr;
 
Hi Cthulhu,

Thanks for the example. :)

Good News is , i was able to do something like this & its working :

double * dArray = new double[4];
CATSafeArrayVariant* oValue = BuildSafeArrayVariant(dArray, 4);
piVBViewObj->Size(*oValue);
delete oValue;

Thank you once again.

 
Use [tt]ConvertSafeArrayVariant[/tt]:

Code:
#include "CATAutoConversions.h"

double coords[4];
CATSafeArrayVariant* arr = BuildSafeArrayVariant(coords, 4);
piVBViewObj->Size(*arr);

ConvertSafeArrayVariant(arr, coords, 4);
delete arr;
 
Hi Little Cthulhu,

Thanks for the information. It really helped me to understand about ArrayVariant.

Thanks again!! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top