TheSwamp

Code Red => ARX Programming => Topic started by: gnanapaul on December 16, 2009, 09:50:38 AM

Title: Display center point
Post by: gnanapaul on December 16, 2009, 09:50:38 AM
Hi...

My code is

Code: [Select]
void CSampDialog::OnShowPoints()
{
AcDbObjectId objid;
AcDbObject* pObj;
if (objid != NULL)
{
AcDbEntity* pObj = NULL;
if(acdbOpenObject(pObj,objid,AcDb::kForRead) == Acad::eOk)
{
AcDbCircle* pCirc = AcDbCircle::cast(pObj);
       if (pCirc !=NULL)
{
double dRadius = pCirc->radius();
AcGePoint3d ptCenter = pCirc->center();
acutPrintf("center %f radius %f", ptCenter, dRadius);
}
pObj->close();
}
else
acutPrintf("\nFailed to open the object.");

}
}


i need to print the center, radius of selected circles.
my above code is not working...

please can any one me?

thanks...
Title: Re: Display center point
Post by: MickD on December 16, 2009, 03:24:02 PM
you need to break the point into it's 3 dimensional parts
eg.

acutPrintf("centre %f,%f,%f", ptCentre.X, ptCentre.Y, ptCentre.Z);

or something like that :)
Title: Re: Display center point
Post by: gnanapaul on December 16, 2009, 10:41:08 PM
you need to break the point into it's 3 dimensional parts
eg.

acutPrintf("centre %f,%f,%f", ptCentre.X, ptCentre.Y, ptCentre.Z);

or something like that :)


Hi...

Thanks for your reply.
problem is in
Code: [Select]
if (objid != NULL)

how to get AcDbObjectId from db?
please tell me...
Title: Re: Display center point
Post by: MickD on December 16, 2009, 11:42:34 PM
Try something like this -
Code: [Select]
void CSampDialog::OnShowPoints()
{
AcDbObjectId objid; // this gets assigned to in the acdbOpenObject method.
AcDbObject* pObj;

AcDbEntity* pObj = NULL;  // ----- you need to get/select an object to set this so you can open it
if(acdbOpenObject(pObj,objid,AcDb::kForRead) == Acad::eOk)
{
AcDbCircle* pCirc = AcDbCircle::cast(pObj);
        if (pCirc !=NULL)
{
double dRadius = pCirc->radius();
AcGePoint3d ptCenter = pCirc->center();
acutPrintf("center %f radius %f", ptCenter, dRadius);
}
pObj->close();
}
else
acutPrintf("\nFailed to open the object.");
}
}
Title: Re: Display center point
Post by: gnanapaul on December 17, 2009, 12:18:07 AM
Hi MickD,

Thanks for your reply.

I used your code. But it shows failed to pen object.

I thing here i have to get selected object'ss objectId from object in the database.

But i don't know how to get objectid from database.

please help me.

thanks again...
Title: Re: Display center point
Post by: It's Alive! on December 17, 2009, 12:34:53 AM
what version of Acad are you targeting?
Title: Re: Display center point
Post by: It's Alive! on December 17, 2009, 12:37:17 AM
you can get an array of IDs in the current selection set by using acdbGetCurrentSelectionSet

Title: Re: Display center point
Post by: gnanapaul on December 17, 2009, 12:59:16 AM
Hi Daniel,

Thanks for your reply.

I am totally newbie to arx. please give code syntax for acdbGetCurrentSelectionSet.

I am using Autocad 2000 and vc6.0

Thanks a lot....
Title: Re: Display center point
Post by: It's Alive! on December 17, 2009, 01:17:58 AM
something like

Code: [Select]
void CSampDialog::OnShowPoints()
{
  AcDbObjectIdArray ids;
  if(acdbGetCurrentSelectionSet(ids) == eOk)
  {
    for(size_t i = 0; i < ids.length() ; i++)
    {
      AcDbEntity* pObj = NULL;
      if(acdbOpenObject(pObj,ids[i],AcDb::kForRead) == Acad::eOk)
      {
        AcDbCircle* pCirc = AcDbCircle::cast(pObj);
        if (pCirc !=NULL)
        {
          double dRadius = pCirc->radius();
          AcGePoint3d ptCenter = pCirc->center();
          acutPrintf("center (%g,%g,%g) radius %g",
            ptCenter.x,ptCenter.y,ptCenter.z, dRadius);
        }
        pObj->close();
      }
      else
        acutPrintf("\nFailed to open the object.");
    }
  }
}
Title: Re: Display center point
Post by: gnanapaul on December 17, 2009, 01:30:39 AM
Hi Daniel,

I used your code. But,

Code: [Select]
error C2065: 'acdbGetCurrentSelectionSet' : undeclared identifier
error C2065: 'eOk' : undeclared identifier
warning C4018: '<' : signed/unsigned mismatch

Shall i include any header file???

Thanks a lot again...

Regards,
Paul.G
Title: Re: Display center point
Post by: It's Alive! on December 17, 2009, 01:38:51 AM
replace eOk with Acad::eOk 
It may be that acdbGetCurrentSelectionSet did not exist in 2000,  the oldest docs I have are for 2002. it should be in  aced.h
If it's not in the 2000 SDK, you might be able to use the 2002 SDK as it is are binary compatible
Title: Re: Display center point
Post by: It's Alive! on December 17, 2009, 01:43:00 AM
Also, if you ever plan on using your code on versions 2007+, you should use TCHAR  &&  _T("") for all your strings i.e acutPrintf(_T("\nARX Rocks!"));
Title: Re: Display center point
Post by: gnanapaul on December 17, 2009, 01:48:40 AM
Hi Daniel,

Code: [Select]
error C2065: 'acdbGetCurrentSelectionSet' : undeclared identifier
is continue.

Code: [Select]
you might be able to use the 2002 SDK as it is are binary compatible

How to use 2002 SDK?
I have included aced.h.


Thanks again...
Title: Re: Display center point
Post by: It's Alive! on December 17, 2009, 01:53:43 AM
<ftp://ftp.autodesk.com/pub/objectarx/objectarx_2002/>
Title: Re: Display center point
Post by: gnanapaul on December 17, 2009, 01:57:14 AM
Hi Daniel,

Code: [Select]
ads_name ss;
if( RTNORM != acedSSGet("P",NULL,NULL,NULL,ss))  
{
if( RTNORM != acedSSGet(NULL,NULL,NULL,NULL,ss))  
{
acDocManager->unlockDocument(acDocManager->curDocument());
return;
}
}

long nEnts;
acedSSLength(ss,&nEnts);
AcDbObjectIdArray entities(nEnts);
acutPrintf("\nFound %d Entities", nEnts);

double pRadius, y_value;
int rc;
ads_name en;
AcGePoint3d pt;

rc = acedEntSel("\nSelect circles: ", en, asDblArray(pt));
if (rc != RTNORM)
{
acutPrintf("\nNo entity selected...");
return;
}
AcDbObjectId eId, eId2;
acdbGetObjectId(eId, en);

AcDbObject *pDbObj;

AcDbCircle *pcircle;
AcGePoint3d *pCenter1 = new AcGePoint3d;
acdbOpenObject(pDbObj, eId, AcDb::kForRead);
AcDbCircle* pCircle = AcDbCircle::cast(pDbObj);
if(pCircle == NULL)
return;
if(pCircle == NULL)
return;
AcGePoint3d pCenter = pCircle->center();
y_value = pCenter.y;
pRadius = pCircle->radius();
acutPrintf("Selected object Y value %f\n", y_value);
acutPrintf("Selected object X value %f\n", pCenter);


This above code working fine. but it shows only one selected circles center. But i need to show multiple circles at a time. please help me to change the code for to show selected circles center point...

Thanks again...
Title: Re: Display center point
Post by: It's Alive! on December 17, 2009, 02:09:19 AM
you need to iterate thought the selections set, here is a helper function to help

Code: [Select]
Acad::ErrorStatus SelectionSetToObjectIds( AcDbObjectIdArray &setIds, ads_name ssname )
{
  long sslength;
  ads_name ent;
  acedSSLength(ssname,&sslength);
  for (long i = 0; i < sslength; i++)
  {
    AcDbObjectId oId;
    acedSSName(ssname, i, ent);
    if(acdbGetObjectId(oId, ent) == eOk)
      setIds.append(oId);
    else
      return Acad::eNullObjectId;
  }
  return eOk;
}
Title: Re: Display center point
Post by: It's Alive! on December 17, 2009, 02:15:42 AM
As you know selection set can contain many objects, once you have converted the selection set to an AcDbObjectIdArray, you need to open each object in the array, cast it to a circle, if it's not null, print your values.
Title: Re: Display center point
Post by: gnanapaul on December 17, 2009, 02:34:10 AM
Hi Daniel,

still its showing single circle center point.

I have added the function SelectionSetToObjectIds. How can i call this function?
from where i can call?

Title: Re: Display center point
Post by: It's Alive! on December 17, 2009, 02:50:00 AM
something like

Code: [Select]
static void ExtTools_test(void)
  {
    OnShowPoints();
  }

  static Acad::ErrorStatus SelectionSetToObjectIds( AcDbObjectIdArray &setIds, ads_name ssname )
  {
    long sslength;
    ads_name ent;
    acedSSLength(ssname,&sslength);
    for (long i = 0; i < sslength; i++)
    {
      AcDbObjectId oId;
      acedSSName(ssname, i, ent);
      if(acdbGetObjectId(oId, ent) == eOk)
        setIds.append(oId);
      else
        return Acad::eNullObjectId;
    }
    return eOk;
  }


  static void OnShowPoints()
  {
    ads_name ss;
    if( RTNORM != acedSSGet(_T("P"),NULL,NULL,NULL,ss)) 
      return;

    AcDbObjectIdArray ids;
    if(SelectionSetToObjectIds(ids,ss) != Acad::eOk)
      return;

    for(size_t i = 0; i < ids.length() ; i++)
    {
      AcDbEntity* pObj = NULL;
      if(acdbOpenObject(pObj,ids[i],AcDb::kForRead) == Acad::eOk)
      {
        AcDbCircle* pCirc = AcDbCircle::cast(pObj);
        if (pCirc !=NULL)
        {
          double dRadius = pCirc->radius();
          AcGePoint3d ptCenter = pCirc->center();
          acutPrintf(_T("\ncenter (%g,%g,%g) radius %g"),
            ptCenter.x,ptCenter.y,ptCenter.z, dRadius);
        }
        pObj->close();
      }
      else
        acutPrintf(_T("\nFailed to open the object."));
    }
    acedSSFree(ss);
  }
Title: Re: Display center point
Post by: It's Alive! on December 17, 2009, 02:55:25 AM
you may need to remove the _T( ) or add tchar.h
Title: Re: Display center point
Post by: gnanapaul on December 17, 2009, 03:59:22 AM
Hi Daniel,

this is also showing error.

Code: [Select]
void CSampDialog::OnShowPoints()
{
ads_name ss;
if( RTNORM != acedSSGet("P",NULL,NULL,NULL,ss))  
{
if( RTNORM != acedSSGet(NULL,NULL,NULL,NULL,ss))  
{
acDocManager->unlockDocument(acDocManager->curDocument());
return;
}
}

long nEnts;
acedSSLength(ss,&nEnts);
AcDbObjectIdArray entities(nEnts);
acutPrintf("\nFound %d Entities", nEnts);

double pRadius, y_value;
int rc;
ads_name en;
AcGePoint3d pt;

rc = acedEntSel("\nSelect circles: ", en, asDblArray(pt));
if (rc != RTNORM)
{
acutPrintf("\nNo entity selected...");
return;
}

AcDbObjectId eId, eId2;
acdbGetObjectId(eId, en);

AcDbObject *pDbObj;

AcDbCircle *pcircle;
AcGePoint3d *pCenter1 = new AcGePoint3d;
acdbOpenObject(pDbObj, eId, AcDb::kForRead);
AcDbCircle* pCircle = AcDbCircle::cast(pDbObj);
if(pCircle == NULL) // means the passed parameter is not an instance of AcDbCircle
return;
if(pCircle == NULL)
return;
AcGePoint3d pCenter = pCircle->center();
y_value = pCenter.y;
pRadius = pCircle->radius();
acutPrintf("Selected object Y value %f\n", y_value);
acutPrintf("Selected object X value %f\n", pCenter);

acedSSFree(ss);
}
This above code is working fine. and please tell me how to change the above code to show multiple(Selected)  circle's center point....

Really you are great. please help me...

Today is my dead line...

Thanks a lot....
Title: Re: Display center point
Post by: gnanapaul on December 17, 2009, 04:44:21 AM
Hi Daniel,

Please help me...
Title: Re: Display center point
Post by: It's Alive! on December 17, 2009, 05:26:34 AM
I'm very sorry, your code is so seriously flawed that I recommend you toss what you have and start with the functions I showed you.

Title: Re: Display center point
Post by: gnanapaul on December 17, 2009, 05:37:10 AM
I'm very sorry, your code is so seriously flawed that I recommend you toss what you have and start with the functions I showed you.



Hi Daniel,

I have used your functions only.

But it shows error.

The errors are

Code: [Select]
error C2065: 'SelectionSetToObjectIds' : undeclared identifier
warning C4018: '<' : signed/unsigned mismatch
error C2373: 'SelectionSetToObjectIds' : redefinition; different type modifiers
Error executing cl.exe.

please help me...

Thanks a lot...
Title: Re: Display center point
Post by: It's Alive! on December 17, 2009, 05:40:27 AM
did you add SelectionSetToObjectIds to your class? or your .h file?
Title: Re: Display center point
Post by: It's Alive! on December 17, 2009, 05:48:01 AM
if you want it as part of your class

Code: [Select]
//add this to your CSampDialog.h file
static Acad::ErrorStatus SelectionSetToObjectIds( AcDbObjectIdArray &setIds, ads_name ssname );

//add this to your CSampDialog.cpp
Acad::ErrorStatus CSampDialog::SelectionSetToObjectIds( AcDbObjectIdArray &setIds, ads_name ssname )
{
    long sslength;
    ads_name ent;
    acedSSLength(ssname,&sslength);
    for (long i = 0; i < sslength; i++)
    {
      AcDbObjectId oId;
      acedSSName(ssname, i, ent);
      if(acdbGetObjectId(oId, ent) == eOk)
        setIds.append(oId);
      else
        return Acad::eNullObjectId;
    }
    return eOk;
  }
Title: Re: Display center point
Post by: gnanapaul on December 17, 2009, 05:49:13 AM
did you add SelectionSetToObjectIds to your class? or your .h file?

yes. I have added like

Code: [Select]
SelectionSetToObjectIds( AcDbObjectIdArray &setIds, ads_name ssme );a also added
Code: [Select]
static void ExtTools_test(void);
static void OnShowPoints1() ;
Title: Re: Display center point
Post by: gnanapaul on December 17, 2009, 05:55:01 AM
It is working good.

Really you are very very good person.

Thanks a lot....

 
Title: Re: Display center point
Post by: It's Alive! on December 17, 2009, 05:59:10 AM
You are welcome  :-)
Title: Re: Display center point
Post by: gnanapaul on December 17, 2009, 06:14:37 AM
Hi Daniel,

I was run correcly at first time.

After that it is not running...

Code in CSampDialog.h

Code: [Select]
public:
CSampDialog( CWnd* pParent = NULL );

void OnCopy2Excell(const char* pWhat, const AcDbObject* pDbObj);
afx_msg void OnShowPoints();
static Acad::ErrorStatus SelectionSetToObjectIds( AcDbObjectIdArray &setIds, ads_name ssname );
static void ExtTools_test(void);

Code in CSampDialog.cpp
Code: [Select]
BEGIN_MESSAGE_MAP(CSampDialog, CDialog)
//{{AFX_MSG_MAP(CSampDialog)
ON_WM_CLOSE()
ON_MESSAGE(WM_ACAD_KEEPFOCUS, onAcadKeepFocus)
ON_BN_CLICKED(IDC_BUTTON2, OnShowPoints)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()


static void ExtTools_test(void)
 {
CSampDialog cmd;
cmd.OnShowPoints();
}

void CSampDialog::OnShowPoints()
{

ads_name ss;
    if( RTNORM != acedSSGet(_T("P"),NULL,NULL,NULL,ss)) 
    return;

AcDbObjectIdArray ids;
    if(CSampDialog::SelectionSetToObjectIds(ids,ss) != Acad::eOk)
    return;

for(size_t i = 0; i < ids.length() ; i++)
    {
AcDbEntity* pObj = NULL;
if(acdbOpenObject(pObj,ids[i],AcDb::kForRead) == Acad::eOk)
{
AcDbCircle* pCirc = AcDbCircle::cast(pObj);
if (pCirc !=NULL)
{
double dRadius = pCirc->radius();
AcGePoint3d ptCenter = pCirc->center();
acutPrintf(_T("\ncenter (%g,%g,%g) radius %g"),
ptCenter.x,ptCenter.y,ptCenter.z, dRadius);
}
pObj->close();
}
else
acutPrintf(_T("\nFailed to open the object."));
    }
acedSSFree(ss);
}

Acad::ErrorStatus CSampDialog::SelectionSetToObjectIds( AcDbObjectIdArray &setIds, ads_name ssname )
{
    long sslength;
    ads_name ent;
    acedSSLength(ssname,&sslength);
    for (long i = 0; i < sslength; i++)
    {
      AcDbObjectId oId;
      acedSSName(ssname, i, ent);
      if(acdbGetObjectId(oId, ent) == Acad::eOk)
        setIds.append(oId);
      else
        return Acad::eNullObjectId;
    }
    return Acad::eOk;
  }


what is the wrong with this?

Thanks...
Title: Re: Display center point
Post by: It's Alive! on December 17, 2009, 06:30:09 AM
I don't see anything wrong with the code, , is this a modal dialog?

remove the ExtTools_test(void) from your .h and .cpp, you don't need it
Title: Re: Display center point
Post by: gnanapaul on December 17, 2009, 06:37:29 AM
I don't see anything wrong with the code, , is this a modal dialog?

remove the ExtTools_test(void) from your .h and .cpp, you don't need it


Ok i had removed. I sent the program to your mail. It is modeless  dialog.

Please check it out...

Thanks...

Regards,

Paul G
Title: Re: Display center point
Post by: It's Alive! on December 17, 2009, 06:52:45 AM
it seems that the zip was stripped by your email server, you might just attach it to a post here ( you can remove it later) .
FYI, I do not have VC6 nor Acad 2000 installed on my computer
Title: Re: Display center point
Post by: gnanapaul on December 17, 2009, 06:59:55 AM
Hi Daniel,

OK...Thanks a lot...

Attaching my code snipt.

Code: [Select]
void CSampDialog::OnShowPoints()
{
    ads_name ss;
    if( RTNORM != acedSSGet(_T("P"),NULL,NULL,NULL,ss)) 
          AfxMessageBox("Error Here itself");
    return;

    AcDbObjectIdArray ids;
    if(CSampDialog::SelectionSetToObjectIds(ids,ss) != Acad::eOk)
AfxMessageBox("objectId");
    return;

for(size_t i = 0; i < ids.length() ; i++)
    {
AcDbEntity* pObj = NULL;
if(acdbOpenObject(pObj,ids[i],AcDb::kForRead) == Acad::eOk)
{
AcDbCircle* pCirc = AcDbCircle::cast(pObj);
if (pCirc !=NULL)
{
double dRadius = pCirc->radius();
AcGePoint3d ptCenter = pCirc->center();
acutPrintf(_T("\ncenter (%g,%g,%g) radius %g"),
ptCenter.x,ptCenter.y,ptCenter.z, dRadius);
}
pObj->close();
}
else
acutPrintf(_T("\nFailed to open the object."));
    }
acedSSFree(ss);
}

Acad::ErrorStatus CSampDialog::SelectionSetToObjectIds( AcDbObjectIdArray &setIds, ads_name ssname )
{
    long sslength;
    ads_name ent;
    acedSSLength(ssname,&sslength);
    for (long i = 0; i < sslength; i++)
    {
      AcDbObjectId oId;
      acedSSName(ssname, i, ent);
      if(acdbGetObjectId(oId, ent) == Acad::eOk)
        setIds.append(oId);
      else
        return Acad::eNullObjectId;
    }
    return Acad::eOk;
  }
code in CSampDialog.h

Code: [Select]
class CSampDialog : public CDialog
{
public:
CSampDialog( CWnd* pParent = NULL );

void OnCopy2Excell(const char* pWhat, const AcDbObject* pDbObj);
afx_msg void OnShowPoints();
static Acad::ErrorStatus SelectionSetToObjectIds( AcDbObjectIdArray &setIds, ads_name ssname );
Title: Re: Display center point
Post by: It's Alive! on December 17, 2009, 07:04:01 AM
I meant attach the zip to a post here  :-)

your missing a few braces

Code: [Select]
void CSampDialog::OnShowPoints()
  {
    ads_name ss;
    if( RTNORM != acedSSGet(_T("P"),NULL,NULL,NULL,ss)) 
    {
      AfxMessageBox("Error Here itself");
      return;
    }

    AcDbObjectIdArray ids;
    if(CSampDialog::SelectionSetToObjectIds(ids,ss) != Acad::eOk)
    {
      AfxMessageBox("objectId");
      return;
    }

    for(size_t i = 0; i < ids.length() ; i++)
    {
      AcDbEntity* pObj = NULL;
      if(acdbOpenObject(pObj,ids[i],AcDb::kForRead) == Acad::eOk)
      {
        AcDbCircle* pCirc = AcDbCircle::cast(pObj);
        if (pCirc !=NULL)
        {
          double dRadius = pCirc->radius();
          AcGePoint3d ptCenter = pCirc->center();
          acutPrintf(_T("\ncenter (%g,%g,%g) radius %g"),
            ptCenter.x,ptCenter.y,ptCenter.z, dRadius);
        }
        pObj->close();
      }
      else
        acutPrintf(_T("\nFailed to open the object."));
    }
    acedSSFree(ss);
  }
Title: Re: Display center point
Post by: gnanapaul on December 17, 2009, 07:08:13 AM
Ok...

I have attached here...
Title: Re: Display center point
Post by: gnanapaul on December 17, 2009, 07:31:55 AM
Hi Daniel,

I thing the Error is in

Code: [Select]
void CSampDialog::OnShowPoints()
{
ads_name ss;
if( RTNORM != acedSSGet(_T("P"),NULL,NULL,NULL,ss))

Title: Re: Display center point
Post by: gnanapaul on December 17, 2009, 07:47:56 AM
Hi Daniel,

Please help me...
Title: Re: Display center point
Post by: It's Alive! on December 17, 2009, 07:53:15 AM
try this

Code: [Select]
void CSampDialog::OnShowPoints()
{
AfxMessageBox("hi");
ads_name ss;
if( RTNORM != acedSSGet(_T("P"),NULL,NULL,NULL,ss))
{
if( RTNORM != acedSSGet(NULL,NULL,NULL,NULL,ss))
{
AfxMessageBox("Erroe Here itself");
return;
}
}

AcDbObjectIdArray ids;
if(CSampDialog::SelectionSetToObjectIds(ids,ss) != Acad::eOk)
{
AfxMessageBox("objectId");
return;
}

for(int i = 0; i < ids.length() ; i++)
{
AcDbEntity* pObj = NULL;
if(acdbOpenObject(pObj,ids[i],AcDb::kForRead) == Acad::eOk)
{
AcDbCircle* pCirc = AcDbCircle::cast(pObj);
if (pCirc !=NULL)
{
double dRadius = pCirc->radius();
AcGePoint3d ptCenter = pCirc->center();
acutPrintf(_T("\ncenter (%g,%g,%g) radius %g"),
ptCenter.x,ptCenter.y,ptCenter.z, dRadius);
}
pObj->close();
}
else
acutPrintf(_T("\nFailed to open the object."));
}
acedSSFree(ss);
}
Title: Re: Display center point
Post by: It's Alive! on December 17, 2009, 07:55:10 AM
"C:myfile.csv" should be "C:\\myfile.csv",
Title: Re: Display center point
Post by: gnanapaul on December 17, 2009, 07:58:25 AM
yes...

It is working...  Thanks a lot...

But it is showing all circles property.

Not showing selected...
Title: Re: Display center point
Post by: It's Alive! on December 17, 2009, 08:11:58 AM
not on mine, it's showing the same data twice though
Title: Re: Display center point
Post by: It's Alive! on December 17, 2009, 08:13:43 AM
and at the command line

center (23.453598,20.164042,0.000000) radius 1.695061
center (14.396755,19.541202,0.000000) radius 2.117912
Title: Re: Display center point
Post by: gnanapaul on December 17, 2009, 08:17:51 AM
yes...

Thanks a lot...

You are genius...

i never forget this help...
Title: Re: Display center point
Post by: It's Alive! on December 17, 2009, 08:21:20 AM
I would add another button to allow the user to select the circles to export  :-)
Title: Re: Display center point
Post by: gnanapaul on December 17, 2009, 08:23:59 AM
Please send me the code snip...
Title: Re: Display center point
Post by: gnanapaul on December 17, 2009, 08:31:08 AM
also If i select 4 circles at first time, it shows 4 center points.

If again i select 10 circles, its shows the previous 4 center points only.

How can solve this problem?

thanks...
Title: Re: Display center point
Post by: It's Alive! on December 17, 2009, 08:46:11 AM
Please send me the code snip...

Code: [Select]
.h
afx_msg void OnSelect();

.cpp
// add to messagemap
ON_BN_CLICKED(IDC_BUTTON5, OnSelect)

//
void CSampDialog::OnSelect()
{
::SetFocus(adsw_acadDocWnd());
ads_name ss;
if( RTNORM == acedSSGet(NULL,NULL,NULL,NULL,ss)) 
{
acedSSFree(ss);
OnShowPoints();
}
}

Title: Re: Display center point
Post by: It's Alive! on December 17, 2009, 08:47:04 AM
also If i select 4 circles at first time, it shows 4 center points.

If again i select 10 circles, its shows the previous 4 center points only.

How can solve this problem?

thanks...

are you selecting them or just highlighting?
Title: Re: Display center point
Post by: gnanapaul on December 17, 2009, 08:54:47 AM
Hi Daniel,

I am selecting...

It is repeating always, first what we have select...

thanks...
Title: Re: Display center point
Post by: It's Alive! on December 17, 2009, 08:58:26 AM
.. sorry got to go, I'll take another look at sunrise.
Title: Re: Display center point
Post by: gnanapaul on December 17, 2009, 09:00:02 AM
okey...

Good Night and sweet dreams...

Bye...
Title: Re: Display center point
Post by: gnanapaul on December 17, 2009, 11:32:37 PM
Hi Daniel,

Good Morning...

Title: Re: Display center point
Post by: gnanapaul on December 17, 2009, 11:49:37 PM
If i select 5 circles at first time, it shows 5 center points.

Again if i select 10 circles, its shows the previous 5 center points only.

How can solve this problem? have you noted this?

thanks...
Title: Re: Display center point
Post by: It's Alive! on December 18, 2009, 12:34:37 AM
Sorry, I had to run to the bank to grab my weekly ration of jelly bellies from the safety deposit box, got a few black ones and a couple of vanilla beans.
Thanks to Mr. KB, I'm in a good mood.

Before we go any further please describe to me what the end goal of the routine is.
Title: Re: Display center point
Post by: It's Alive! on December 18, 2009, 12:48:58 AM
The reason you are getting the previous selection set is because this is the way you have it coded. If it is not the previous selection you want, open the docs and have a look at the AcEdInputContextReactor::endSSGet reactor. see if it existed in 2000  :-)
Title: Re: Display center point
Post by: Kerry on December 18, 2009, 01:37:23 AM
Sorry, I had to run to the bank to grab my weekly ration of jelly bellies from the safety deposit box, got a few black ones and a couple of vanilla beans.
Thanks to Mr. KB, I'm in a good mood.


hehehe  .. Lorraine is rationing mine  :-)  don't have many left