ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

reverseCurve

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
463017170
236 Views, 2 Replies

reverseCurve

1.png

 

static void  MyGroupMyCommand() {
	ads_name ss;
	resbuf* rbList = acutBuildList(RTDXF0, _T("LWPOLYLINE,ARC,SPLINE"), RTNONE);
	int stat = acedSSGet(NULL, NULL, NULL, rbList, ss);
	if (rbList)
		acutRelRb(rbList);
	if (RTNORM != stat)
		return;
	Adesk::Int32 nSSLength = 0;
	acedSSLength(ss, &nSSLength);
	AcDbEntity *pEnt = NULL;
	for (Adesk::Int32 i = 0; i < nSSLength; i++)
	{
		ads_name ent;
		acedSSName(ss, i, ent);
		AcDbObjectId objId;
		acdbGetObjectId(objId, ent);

		Acad::ErrorStatus es = acdbOpenObject(pEnt, objId, AcDb::kForRead);
		if (es != Acad::eOk)
			return;
		if (pEnt->isKindOf(AcDbCurve::desc()))
		{
			double startParam, endParam;
			AcGePoint3d  Ptstart,Ptend;
			AcDbCurve *pCurve = AcDbCurve::cast(pEnt);
			 pCurve->reverseCurve();
			 pCurve->close();
		}
		pEnt->close();
	}
	acedSSFree(ss);
}

 

 

2 REPLIES 2
Message 2 of 3
tbrammer
in reply to: 463017170

A formulated question would be helpful 😉.

However: You only opened the curve kForRead. So you can't modify it with reverseCurve().

Use es = curve->upgradeOpen() and check that es==Acad:.eOk.


Thomas Brammer ● Software Developer ● imos AGLinkedIn
If an answer solves your problem please [ACCEPT SOLUTION]. Otherwise explain why not.

Message 3 of 3
463017170
in reply to: tbrammer

The details are wrong again! Thank you very much!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


AutoCAD Beta