Author Topic: AcDbExtents Implementation...  (Read 4199 times)

0 Members and 1 Guest are viewing this topic.

LE

  • Guest
AcDbExtents Implementation...
« on: April 27, 2006, 11:44:45 AM »
Question:

If I call AcDbExtents as I have it on the code below it will broke the intellisense until I added the & in front of the variable name, but when I do the compile it will ask for being initialize, so I take out the & and the error is gone, and the SLN can be compiled... but all of the intellisense after that line is not available, only if I removed that line it comes up, anyone knows why?

I am looking for a way to get the extents of an object that it is in a viewtwist view.... also that would be the hard part....

Thanks!

Code: [Select]
static void GetExtents(void) {
  ads_name en;
  AcGePoint3d p;
  Acad::ErrorStatus es;
  AcDbObjectId objId;
  if (acedEntSel("\nSelect object: ",en,asDblArray(p)) != RTNORM) return;
  if (acdbGetObjectId(objId,en) != Acad::eOk) return;
  AcDbObjectPointer<AcDbEntity> pEnt(objId,AcDb::kForRead);
  if (pEnt.openStatus() == Acad::eOk) {
  AcDbExtents extents; // <<<--- here
  pEnt->getGeomExtents(extents);
  AcGePoint3d max, min;
  max = extents.maxPoint();
  min = extents.minPoint();

}

LE

  • Guest
Re: AcDbExtents Implementation...
« Reply #1 on: April 27, 2006, 03:38:03 PM »
OK.... then I will guess, it is a bug?

Alexander Rivilis

  • Bull Frog
  • Posts: 212
  • Programmer from Kyiv (Ukraine)
Re: AcDbExtents Implementation...
« Reply #2 on: April 27, 2006, 03:55:47 PM »
:) What about close }  at end of function?

MickD

  • Gator
  • Posts: 3289
  • (x-in)->[process]->(y-out)
Re: AcDbExtents Implementation...
« Reply #3 on: April 27, 2006, 06:22:59 PM »
also, try it with the '&' in the function call as in the function signiture it takes the 'address' of the variable so it knows where to store the result.

pEnt->getGeomExtents(&extents);

hth
Debugging:
Being the detective in a crime movie where you're also the murderer.

“Someone's sitting in the shade today because someone planted a tree a long time ago.”
- Warren Buffet

LE

  • Guest
Re: AcDbExtents Implementation...
« Reply #4 on: April 27, 2006, 08:00:29 PM »
:) What about close }  at end of function?

Yep I forgot the closing } on the code I posted... but does not help.... it is doing the same, only if I removed the call to AcDbExtents it will bring the intellisense... or if I add a & to the variable, but also the next call to minPoint and maxPoint properties, it does not bring intellisense.... very strange....


Thanks.

LE

  • Guest
Re: AcDbExtents Implementation...
« Reply #5 on: April 27, 2006, 08:05:33 PM »
also, try it with the '&' in the function call as in the function signiture it takes the 'address' of the variable so it knows where to store the result.

pEnt->getGeomExtents(&extents);

hth

I tried all the possibilities, this one too... and does not work... I tested also in another computer and does the same

MickD

  • Gator
  • Posts: 3289
  • (x-in)->[process]->(y-out)
Re: AcDbExtents Implementation...
« Reply #6 on: April 27, 2006, 08:19:50 PM »
AcDbExtents *extents;
  pEnt->getGeomExtents(extents);

??
Debugging:
Being the detective in a crime movie where you're also the murderer.

“Someone's sitting in the shade today because someone planted a tree a long time ago.”
- Warren Buffet

Chuck Gabriel

  • Guest
Re: AcDbExtents Implementation...
« Reply #7 on: April 27, 2006, 08:23:44 PM »
getGeomExtents takes its argument by reference (not by pointer), so it is correct to call it as it is shown in the code Luis posted.

Regarding Intellisense, the only way I have ever gotten it to work correctly for ObjectARX is to follow the advice of Tony Tanzillo.  You create a new ObjectARX project and add all of the ObjectARX headers to it.  Then you insert this project into the workspace of each of your ObjectARX projects and do a full compile.  After that, Intellisense (usually) works.

LE

  • Guest
Re: AcDbExtents Implementation...
« Reply #8 on: April 27, 2006, 08:47:26 PM »
No.... it does not work at all.... if I take out AcDbExtents extents;, everything works.... I tried also on other SLN's... and same stuff.

OK, no big deal I thought was me....

Thanks!

Chuck Gabriel

  • Guest
Re: AcDbExtents Implementation...
« Reply #9 on: April 27, 2006, 08:50:40 PM »
Your code compiles fine for me (after adding the closing brace) in VC++ 6.0.  Intellisense even works after inserting the dummy project with all the ObjectARX headers into the workspace.

Glenn R

  • Water Moccasin
  • Posts: 1932
  • What idiot child of married cousins wrote this?!
Re: AcDbExtents Implementation...
« Reply #10 on: April 28, 2006, 01:37:58 AM »
If you're using Visual Studio C++ and want correct intellisense, then you can NOT beat Visual Assist by WholeTomato...absolutely awesome...what intellisense should have been.
Me

Draftek

  • Water Moccasin
  • Posts: 1501
Re: AcDbExtents Implementation...
« Reply #11 on: April 28, 2006, 08:21:21 AM »
^ Agreed....
Soli Deo Gloria