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

ACAD2013 - acedssget issue

6 REPLIES 6
Reply
Message 1 of 7
Anonymous
1151 Views, 6 Replies

ACAD2013 - acedssget issue

Hi,

I'm experiencing sometimes an issue with acedssget()

 

I call this function with these parameters

 

acedSSGet(_T("C"), ads_point1, ads_point2 , NULL, ssname);

 

I have custom entities ihneriting from acdbline with extended dictionaries.

 

I draw a network of acdbline and I construct with a recursive funcion the tree representing the network.

 

Sometimes it works, but sometimes it doesn't and on a selection it don't return all the crossing elements..

 

Why?

 

I think it's due to some object opened and not properly closed in my algorithm.. could it be?

 

Is there a function to close all open object on the database? or to flush some data used by acedSSGet?

 

Thank you for your help.

6 REPLIES 6
Message 2 of 7
Anonymous
in reply to: Anonymous

are you checking the errors on the functions you call? if you are you will find what is not closed etc. What does acedSSGet return?

 

 

 

Message 3 of 7
Anonymous
in reply to: Anonymous

Hi,

SSGET return always 5100 RTNORM,

but it doesn't return all the objects I expect.

 

I tried to move(with a MOVE command) some unselected objects and reposition in the same position as they were, and after this operation, ssget works well.

 

What could be the cause?

 

Thank you for your time.

Message 4 of 7
Anonymous
in reply to: Anonymous

objects inside ads_point1-ads_point2 box MUST be on the screen (visible).
so, try to zoom window (ads_point1-ads_point2) before acedSSGet
Message 5 of 7
Anonymous
in reply to: Anonymous

Hi,

you are right!!

 

How can I zoom out with objectarx at all to show all the objects on my drawing?

 

Thank you a lot!

 

Regards

Message 6 of 7
Matti72
in reply to: Anonymous

You can use the AutoCAD Command _Zoom and do a _Zoom _Extents:

 

acedCommand( RTSTR, _T("_ZOOM"), RTSTR, _T("_E"), RTNONE );

 

Or you can use a function like this to define your Zoom Window:

 

void SetZoomWindow( AcGePoint3d ul, AcGePoint3d or, double fakt )
{
	AcGePoint3d		mid, lu, ro;
	AcGeVector3d	dv;

	mid = ul+(or-ul)/2.0;

	dv = (ul-mid)/fakt;
	lu = mid+dv;

	dv = (or-mid)/fakt;
	ro = mid+dv;

	AcDbViewTableRecord view;
	AcGePoint2d max_2d( ro[X], ro[Y] );
	AcGePoint2d min_2d( lu[X], lu[Y] ); 


	view.setCenterPoint( min_2d + (max_2d - min_2d) / 2.0 );
	view.setHeight( max_2d[Y] - min_2d[Y] );
	view.setWidth( max_2d[X] - min_2d[X] );     
	acedSetCurrentView( &view, NULL );
}

 

 

 

 

 

 

 

 

 

 

 

 

 

Message 7 of 7
loic.jourdan
in reply to: Anonymous

If you want to iterate through model space entities to get/modify your lines you can do something like this:

 

#include "dbobjptr.h"
#include "dbobjptr2.h"
//...

//get the modelspace pointer of the current database AcDbBlockTableRecordPointer ms(ACDB_MODEL_SPACE,acdbHostApplicationServices()->workingDatabase(),AcDb::kForWrite); if(ms.openStatus()==Acad::eOk) { AcDbBlockTableRecordIterator *pIter; if (ms->newIterator(pIter )==Acad::eOk) { AcDbObjectId oid; AcDbSmartObjectPointer<MyLineType> line(oid,AcDb::kForWrite);//opened for modify if (line.openStatus()==Acad::eOk) //will fail if object pointed by oid is not a MyLineType { line->foo();//process here } delete pIter;//don't forget to delete the pointer, ms would be "corrupted" for further use } }

 Cheers

----
20-20 CAD / 20-20 Technologies

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

Post to forums  

Autodesk Design & Make Report

”Boost