ObjectARX

Reply
Mentor
diagodose2009
Posts: 259
Registered: ‎12-04-2009
Message 1 of 2 (238 Views)

How to extract AcDbObjectId for AcBrFace?

238 Views, 1 Replies
01-29-2013 06:51 AM

Hello.

I need routine extracting AcDbObjectId for 3dFace inside AcDb3DSolid..

Can you replace "????" at source bellow, at :heart:

I need two vars: id_my_for_face=...., current_face_have_name=.............

Thank ,you.....  in advance

:robotsad:

 

[source=c++arx]

 

  Adesk::Boolean ownTransaction;
  AcDbObjectId id;
  AcArray<AcDbFullSubentPath*> subentIds;
  id.setNull();
  AcDb3dSolid* pSolid=nil;
  AcDbObject * pObj=nil;

..............................
    con_ercad = actrTransactionManager->getObject(pObj, objId, AcDb::kForWrite);
    pSolid = AcDb3dSolid::cast(pObj);
    if (pSolid == nil)
           { dbAbortTransaction(ownTransaction);
             pObj->close();
             exitif(1,"g412.error cps");
           };
...........................
   AcBrBrep breptemp;
   kj=dfn_var_AcDbEntity2AcBrBrep(pSolid,breptemp);
   AcBrBrepFaceTraverser brepFaceTrav;
   con_ercad = brepFaceTrav.setBrep(breptemp);
...............................
    int faceCount = 0;
//(Make sure ACIS is there)
    Adesk::Boolean acisStarted = acdbIsModelerStarted();
    acdbModelerStart();
//(/Make sure ACIS is there)
    while (!brepFaceTrav.done() && (con_ercad == AcBr::eOk))
       {
.......................................
                     AcDbFullSubentPath *caletemp = new (AcDbFullSubentPath);
                     if (con_ercad==1)
                        { con_ercad=faceEntity.getSubentPath(*caletemp);
                          con_ercad=(con_ercad==AcBr::eOk)?1:RTCAN;
                        };
                    if (con_ercad==1) //okai
                        subentIds.append(caletemp);
         con_ercad = brepFaceTrav.next();
       }
................................................

kj=dfn_face_setrgbA(subentIds,pSolid,pObj,ownTransaction);
  if (kj<0) { ads_retint(RTERROR);return(rr);};
  kj=RTREJ;
  int faceCount=subentIds.length();
  AcDbFullSubentPath *caleuser=nil;
  if (arguindx<faceCount)
      {
        lspfn_redraw(pSolid->objectId(),4);
        caleuser=subentIds[arguindx];
        pSolid->highlight(caleuser,0);
     };
   ads_name eName;
   ads_name_clear(eName);
   rb=nil;
   daok=0;
   tip=0;
   if (caleuser) 
      {  int cateavem=0;
         tip=caleuser->subentId().index();
         AcDbObjectIdArray m_objIds;
         m_objIds=caleuser->objectIds();
         cateavem=m_objIds.length();  //cateavem==1
         if(cateavem>0)
             id_mysolid=m_objIds[0];  // here the ID=forAcDb3Dsolid ,not for Face

.:smileytongue:.:smileytongue:.:smileytongue:.:smileytongue:.:smileytongue:.:smileytongue:

        AcDbObjectId id_my_for_face="????"

:heart:

        ads_name  current_face_have_name="????"

..................................................................................................

        //id=pSolid->objectId();
        delete(caleuser);
        caleuser=nil;
        daok=1;
       };
   subentIds.removeAll();

[/source=c++arx]

 

Moderator
Alexander.Rivilis
Posts: 1,398
Registered: ‎04-09-2008
Message 2 of 2 (202 Views)

Re: How to extract AcDbObjectId for AcBrFace?

02-02-2013 01:27 AM in reply to: diagodose2009

Short answer: AcBrFace object has not AcDbObjectId as far as AcBrFace object can not be database resident object.


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community