Message 1 of 1
AddRectangularPattern : what it's wrong ?

Not applicable
10-28-2009
06:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone.
I'm trying to use AddRectangularPattern. Following my code. AddRectangularPattern crash. what its wrong ? Can anyone help me. Thankyou in advance.
Ezio
////
CComPtr pEntityAsse( pSelectSet->GetItem(1)); /// WORK AXIS
CComPtr pEntityGradino( pSelectSet->GetItem(2)); /// COMPONENT OCCURENCE
CComPtr pFeatures;
hr=BaseObj.m_pAssemblyComponentDefinition->get_Features( &pFeatures);
///
CComPtr pTransientObjects;
pTransientObjects=m_pApplication->GetTransientObjects();
VARIANT vopt;
VariantInit(&vopt);
V_VT(&vopt) = VT_ERROR;
vopt.scode = DISP_E_PARAMNOTFOUND;
CComPtr pGradiniCollection;
hr=pTransientObjects->CreateObjectCollection( vopt, &pGradiniCollection);
hr=pGradiniCollection->Add( pEntityGradino);
VARIANT_BOOL nDirezione=TRUE;
CComPtr pOccurrencePatterns=BaseObj.m_pAssemblyComponentDefinition->GetOccurrencePatterns();
CComPtr pRectangularOccurrencePattern;
hr=pOccurrencePatterns->AddRectangularPattern( pGradiniCollection
, pEntityAsse
, nDirezione /// VARIANT_BOOL ColumnEntityNaturalDirection
, CComVariant( "rPatternPedata") /// const VARIANT & ColumnOffset
, CComVariant( "nAlzateCalcolateRampa1") /// const VARIANT & ColumnCount
, vtMissing /// const VARIANT & RowEntity
, vtMissing /// VARIANT_BOOL RowEntityNaturalDirection
, vtMissing /// const VARIANT & RowOffset
, vtMissing /// const VARIANT & RowCount
, &pRectangularOccurrencePattern);
I'm trying to use AddRectangularPattern. Following my code. AddRectangularPattern crash. what its wrong ? Can anyone help me. Thankyou in advance.
Ezio
////
CComPtr
CComPtr
CComPtr
hr=BaseObj.m_pAssemblyComponentDefinition->get_Features( &pFeatures);
///
CComPtr
pTransientObjects=m_pApplication->GetTransientObjects();
VARIANT vopt;
VariantInit(&vopt);
V_VT(&vopt) = VT_ERROR;
vopt.scode = DISP_E_PARAMNOTFOUND;
CComPtr
hr=pTransientObjects->CreateObjectCollection( vopt, &pGradiniCollection);
hr=pGradiniCollection->Add( pEntityGradino);
VARIANT_BOOL nDirezione=TRUE;
CComPtr
CComPtr
hr=pOccurrencePatterns->AddRectangularPattern( pGradiniCollection
, pEntityAsse
, nDirezione /// VARIANT_BOOL ColumnEntityNaturalDirection
, CComVariant( "rPatternPedata") /// const VARIANT & ColumnOffset
, CComVariant( "nAlzateCalcolateRampa1") /// const VARIANT & ColumnCount
, vtMissing /// const VARIANT & RowEntity
, vtMissing /// VARIANT_BOOL RowEntityNaturalDirection
, vtMissing /// const VARIANT & RowOffset
, vtMissing /// const VARIANT & RowCount
, &pRectangularOccurrencePattern);