Author Topic: Help! How to Offset My Custom Curve by ARX2009  (Read 1943 times)

0 Members and 1 Guest are viewing this topic.

ahlzl

  • Guest
Help! How to Offset My Custom Curve by ARX2009
« on: January 26, 2009, 11:45:16 AM »
Thanks your help!

I Overridden isPlanar、getPlane、getOffsetCurves,but fail…… :x

Code: [Select]
Adesk::Boolean ahlzlCus::isPlanar () const
{
assertReadEnabled () ;
return Adesk::kTrue ;
}

Acad::ErrorStatus ahlzlCus::getPlane(AcGePlane& plane, AcDb::Planarity& type) const
{
assertReadEnabled();
plane.set(AcGePoint3d::kOrigin, AcGeVector3d::kZAxis);
type = AcDb::kPlanar;
return Acad::eOk;
}

Acad::ErrorStatus ahlzlCus::getOffsetCurves (double offsetDist, AcDbVoidPtrArray &offsetCurves) const
{
assertReadEnabled();
Acad::ErrorStatus es;

es = mpCurve->getOffsetCurves(offsetDist, offsetCurves);

if(es != Acad::eOk)
return es;

int length = offsetCurves.length();
ahlzlCus *pCurve;
AcDbCurve *pOffsetCurve;

for(int i=0; i<length; i++)
{
pOffsetCurve = AcDbCurve::cast((AcRxObject *)offsetCurves[i]);
if(pOffsetCurve == NULL)
continue;
pCurve = new ahlzlCus(pOffsetCurve, this);
offsetCurves[i] = pCurve;
}

return Acad::eOk;
}


Spike Wilbury

  • Guest
Re: Help! How to Offset My Custom Curve by ARX2009
« Reply #1 on: January 26, 2009, 01:32:13 PM »
I can't open .RAR files....

But, if your are deriving from a AcDbCurve your custom entity, why not just use this (not tested):

Code: [Select]
Acad::ErrorStatus ahlzlCus::getOffsetCurves (double offsetDist, AcDbVoidPtrArray &offsetCurves) const
{
Acad::ErrorStatus es = AcDbCurve::getOffsetCurves (offsetDist, offsetCurves) ;
return ( es ) ;
}

ahlzl

  • Guest
Re: Help! How to Offset My Custom Curve by ARX2009
« Reply #2 on: January 27, 2009, 02:25:43 AM »
.RAR file is OK. please download the file.

Spike Wilbury

  • Guest
Re: Help! How to Offset My Custom Curve by ARX2009
« Reply #3 on: January 27, 2009, 09:28:20 AM »
.RAR file is OK. please download the file.

What I mean, is that I do not use .RAR files.