0 Replies Latest reply on Mar 18, 2014 6:25 AM by Mahadev Dharme

    Query regarding equal length radius relation between sketch line and sketch arc

    Mahadev Dharme

      Hi,

       

      I am trying to apply equal length radius relation/constraint between sketch line and sketch arc, but it fails to apply the relation.

      If I add the same relation between two lines with same lengths then it works fine.

       

      Please refer the sample code which reproduces the issue:

       

      //------------------------------------------------------------------------------------------------------------------------

       

      ISketchSegment *line = NULL, *arc = NULL/*, *line1 = NULL*/;

      sketchManager->CreateLine(0.0, 0.0, 0.0, 0.03, 0.0, 0.0, &line);

      sketchManager->CreateArc(0.01, 0.01, 0.0, 0.01, 0.04, 0.0, 0.04, 0.01, 0.0, -1, &arc);

      //sketchManager->CreateLine(0.01, 0.01, 0.0, 0.04, 0.01, 0.01, &line1);

       

      CComQIPtr<ISelectData> swSelData;

      m_selectionManager->CreateSelectData(&swSelData);

       

      long mark = 1;

      swSelData->put_Mark(mark);

       

      VARIANT_BOOL retVal = FALSE;

      line->Select4(TRUE, swSelData, &retVal);

      arc->Select4(TRUE, swSelData, &retVal);

      //line1->Select4(TRUE, swSelData, &retVal);

       

      LPDISPATCH* EntityArray = new LPDISPATCH[2];

      EntityArray[0] = line;

      EntityArray[1] = arc;

      //EntityArray[1] = line1;

       

      ISketch* SWketch = NULL;

      line->GetSketch(&SWketch);

       

      ISketchRelationManager *sketchRelationMgr = NULL;

      SWketch->get_RelationManager(&sketchRelationMgr);

       

      ISketchRelation* lpSketchRelation = NULL;

      HRESULT hr = sketchRelationMgr->IAddRelation(2, EntityArray, swConstraintType_SAMELENGTH, &lpSketchRelation);

       

      VARIANT_BOOL deSel = FALSE;

      line->DeSelect(&deSel);

      arc->DeSelect(&deSel);

      //line1->DeSelect(&deSel);

       

      //------------------------------------------------------------------------------------------------------------------------

       

      Please tell me, why the equal length radius relation failing in case of line and arc?

       

      Thanks in advance!