Author Topic: Persistent Reactors Group  (Read 5442 times)

0 Members and 2 Guests are viewing this topic.

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Persistent Reactors Group
« on: June 03, 2010, 07:46:50 AM »
How can one tell in Visual LISP if an object has a persistent reactor group attached to it?

For example in Vanilla we have:

Code: [Select]
(102 . "{ACAD_REACTORS")
(330 . <Entity name: 7ef038e0>)
(102 . "}")

What is the synonymous method in VL, if there is one?

Many thanks for your advice,

Lee

LE3

  • Guest
Re: Persistent Reactors Group
« Reply #1 on: June 03, 2010, 10:33:15 AM »
(vlr-pers-p reactor)

?

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Persistent Reactors Group
« Reply #2 on: June 03, 2010, 10:35:45 AM »
Thanks for your reply Luis, I had looked into the reactor functions - however, there is no reactor object to be working with - only the VLA-Object that the reactor is attached to.

Such as in the case of a Polyline Viewport  :wink:

LE3

  • Guest
Re: Persistent Reactors Group
« Reply #3 on: June 03, 2010, 10:37:14 AM »
Thanks for your reply Luis, I had looked into the reactor functions - however, there is no reactor object to be working with - only the VLA-Object that the reactor is attached to.

Such as in the case of a Polyline Viewport  :wink:
maybe ? some start...
Code: [Select]
(defun rwiz-partof  (obj / obj_reactors)
  (if (setq obj_reactors
     (cdar (vlr-reactors :vlr-object-reactor)))
    (vl-some
      (function (lambda (n) (numberp n)))
      (mapcar
(function (lambda (r) (vl-position obj (vlr-owners r))))
obj_reactors))))

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Persistent Reactors Group
« Reply #4 on: June 03, 2010, 10:43:30 AM »
Thanks for your reply Luis, I had looked into the reactor functions - however, there is no reactor object to be working with - only the VLA-Object that the reactor is attached to.

Such as in the case of a Polyline Viewport  :wink:
maybe ? some start...
Code: [Select]
(defun rwiz-partof  (obj / obj_reactors)
  (if (setq obj_reactors
     (cdar (vlr-reactors :vlr-object-reactor)))
    (vl-some
      (function (lambda (n) (numberp n)))
      (mapcar
(function (lambda (r) (vl-position obj (vlr-owners r))))
obj_reactors))))
Seems like that would only work if you selected the Viewport instead of the LWPolyline.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Persistent Reactors Group
« Reply #5 on: June 03, 2010, 10:45:01 AM »
Nevermind, that doesn't work either...

Code: [Select]
(rwiz-partof (vlax-ename->vla-object (ssname (ssget '((0 . "VIEWPORT"))) 0)))
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Persistent Reactors Group
« Reply #6 on: June 03, 2010, 10:47:31 AM »
Yes, it appears that the persistent reactors associated with such objects are not listed in the reactor list.  :|

LE3

  • Guest
Re: Persistent Reactors Group
« Reply #7 on: June 03, 2010, 10:47:50 AM »
Nevermind, that doesn't work either...

Code: [Select]
(rwiz-partof (vlax-ename->vla-object (ssname (ssget '((0 . "VIEWPORT"))) 0)))
have not played with vlisp reactors in a long time.... and don't think i understood what you boys are doing... need to get my second cup of coffee here...'please explain with apples and oranges  :lol:

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Persistent Reactors Group
« Reply #8 on: June 03, 2010, 10:51:19 AM »
Nevermind, that doesn't work either...

Code: [Select]
(rwiz-partof (vlax-ename->vla-object (ssname (ssget '((0 . "VIEWPORT"))) 0)))
have not played with vlisp reactors in a long time.... and don't think i understood what you boys are doing... need to get my second cup of coffee here...'please explain with apples and oranges  :lol:
LoL
Is it possible to check and extract if any apples are associated to a selected orange (type vla-object) with persistent reactors.
 :lol:
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

LE3

  • Guest
Re: Persistent Reactors Group
« Reply #9 on: June 03, 2010, 11:04:51 AM »
Yes, it appears that the persistent reactors associated with such objects are not listed in the reactor list.  :|
how Alan knew about the viewport usage?.... anyway if you are using the (vlr-pers-list) that is not going to return anything only the ones you created on your namespace...afaik

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Persistent Reactors Group
« Reply #10 on: June 03, 2010, 11:06:24 AM »
Yes, it appears that the persistent reactors associated with such objects are not listed in the reactor list.  :|
how Alan knew about the viewport usage?.... anyway if you are using the (vlr-pers-list) that is not going to return anything only the ones you created on your namespace...afaik


Started from a thread over @ CADTutor.
http://www.cadtutor.net/forum/showthread.php?t=45263&page=3
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

LE3

  • Guest
Re: Persistent Reactors Group
« Reply #11 on: June 03, 2010, 11:11:56 AM »
Started from a thread over @ CADTutor.
oooo i seeee
maybe it can be done some arx function to add this feature... below it is what i do in a case similar to this - in lisp i'm out of date:
Code: [Select]
static void AddSideItemsOnSegment(void)
{
ads_name ename;
ads_point pt, ptWcs;
AcDbObjectId oid;
if (acedEntSel(_T("\nSelect side on heavy polyline with closed polygon: "), ename, pt) != RTNORM) return;
acdbUcs2Wcs(pt, ptWcs, Adesk::kFalse); // Convert to WCS in case selection was made while in a UCS.
acdbGetObjectId(oid, ename);

AcDbObjectPointer<AcDb2dPolyline> pOutline(oid, AcDb::kForRead);
if (pOutline.openStatus() != Acad::eOk) return;

// check if have a closed polygon attached!
bool haveClosedPoygon = false;
AcDbVoidPtrArray* pArray = pOutline->reactors();
if (pArray && pArray->length() > 0)
{
for (int i = 0; i < pArray->length(); i++)
{
void* pVoid = pArray->at(i);
if (acdbIsPersistentReactor(pVoid))
{

AcDbObjectId reactorId = acdbPersistentReactorObjectId(pVoid);
AcDbObjectPointer<csdbClosedPolygon> cPolygon(reactorId, AcDb::kForWrite); // we need to save some side data on this object!
if (cPolygon.openStatus() == Acad::eOk)
{ ...

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Persistent Reactors Group
« Reply #12 on: June 03, 2010, 11:27:06 AM »
Ahhh! Arx....  :cry:

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Persistent Reactors Group
« Reply #13 on: June 03, 2010, 11:27:59 AM »
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

LE3

  • Guest
Re: Persistent Reactors Group
« Reply #14 on: June 03, 2010, 12:02:48 PM »
Ahhh! Arx....  :cry:
X2 :cry: :cry:
:-o
did a quick test command, someone wants to tried?... (will allow to select viewports only! for A2010)
Command: TEST1

It simple will display if the selected object have persistent reactors attached - then later if works we can add the return of list of objects... will see - maybe
edit: took out the arx that was attached - reason: does not work -
« Last Edit: June 03, 2010, 10:13:33 PM by LE3 »