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

How to isolate/hide objects like command _isolateobjects?

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
maisoui
2377 Views, 5 Replies

How to isolate/hide objects like command _isolateobjects?

Hi,

 

I'd like to isolate or hide objects like command _isolateobjects. So my idea is to change the visibility for each object/entity, but how to tell AutoCAD that an isolation is active? My goal is to interact with the isolation icon in the status bar (bottom right) and to be able to click on End Object Isolation:

 

oarx_isolation.png

 

All suggestions are welcomed.

Regards,

Jonathan

 

--
Jonathan
5 REPLIES 5
Message 2 of 6
loic.jourdan
in reply to: maisoui

Hi,

I'm also interested in driving this feature using object arx, I've unfortunately found nothing about this in the documentation. I should like to bring this topic up on the list in case of someone at autodesk could give us more information.

 

cheers

 

Loic Jourdan

----
20-20 CAD / 20-20 Technologies
Message 3 of 6
Anodl
in reply to: maisoui

Hi Jonathan,

 

I belief that there is no API to interact with the isolate command or the icon in the status bar. But you can call the isolate command from your code.

Try something like that:

 

    AcDbObjectIdArray arrIds;

//    fill arrIds with the object ids of the objects you want to isolate
    ...
    ...

    if (arrIds.length())
        {
        ads_name ss;
        acedSSAdd(NULL,NULL,ss);

        for (int i=0; i<arrIds.length();++i)
            {
            ads_name eName;
            acdbGetAdsName(eName,arrIds.at(i));
            acedSSAdd(eName,ss,ss);
            }

        acedCommand(
                                    RTSTR, _T("_ISOLATEOBJECTS"),
                                    RTPICKS, ss,
                                    RTSTR, _T(""),
                                    RTNONE
                             );
        }

 

 

HTH

Arnold

Message 4 of 6
NikolayPoleshchuk
in reply to: maisoui

You can use "visible" property that is managed by 60 DXF code in entity's data (if it is set to 1 then entity becomes invisible).
Nikolay Poleshchuk
http://poleshchuk.spb.ru/cad/eng.html
Message 5 of 6
maisoui
in reply to: NikolayPoleshchuk

Yes you're right, but it will not be integrated with AutoCad Object Isolation (as I mentionned).

Maybe you didn't read my entire question?

Regards,

--
Jonathan
Message 6 of 6
maisoui
in reply to: maisoui

The solution of Anodl works very well, even if woking with AutoCAD commands is not my favorite code. A few remarks:

  • You can use _.hideobjects or _.isolateobjects to hide or isolate objects
  • If you have groups, you need to open group (for read) and retrieve all entities id with method allEntityIds()
  • In FIBERLESS world, you need to use acedCommandS (subroutine)
  • Add acedSSFree(ss) to clear selection set
Acad::ErrorStatus es;

//create selection set
ads_name ss;
acedSSAdd(NULL, NULL, ss);
for(int i=0; i<ids.length(); ++i)
{
	ads_name eName;
	es = acdbGetAdsName(eName, ids.at(i));
	acedSSAdd(eName, ss, ss);
}

//execute command
acedCommandS(RTSTR, bHide ? _T("_.hideobjects") : _T("_.isolateobjects"), RTPICKS, ss, RTSTR, _T(""), RTNONE);

acedSSFree(ss);

 

Regards,

--
Jonathan

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

Post to forums  

Autodesk Design & Make Report

”Boost