TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Lee Mac 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:
(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
-
(vlr-pers-p reactor)
?
-
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:
-
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...
(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))))
-
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...
(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.
-
Nevermind, that doesn't work either...
(rwiz-partof (vlax-ename->vla-object (ssname (ssget '((0 . "VIEWPORT"))) 0)))
-
Yes, it appears that the persistent reactors associated with such objects are not listed in the reactor list. :|
-
Nevermind, that doesn't work either...
(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:
-
Nevermind, that doesn't work either...
(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:
-
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
-
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
(http://www.giantbrain.co.uk/phpBB2/templates/subSilver/images/logo_phpBB.gif)
Started from a thread over @ CADTutor.
http://www.cadtutor.net/forum/showthread.php?t=45263&page=3
-
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:
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)
{ ...
-
Ahhh! Arx.... :cry:
-
Ahhh! Arx.... :cry:
X2 :cry: :cry:
-
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 -
-
tried and does not return anything.... :-(
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
-
ok... did a little research on some of my old stuff:
1. The persistent data it is saved inside of the dictionary: "VL-REACTORS" or can be verified using: (vlr-pers-dictname)
2. Just call: (entget (namedobjdict)) and in there will be something: (3 . "VL-REACTORS")
3. Then it can be access with: (setq dict (dictsearch (namedobjdict) (vlr-pers-dictname)))
4. Here extract the value below: (3 . "$DOC$")
5. After extracting the 350 value something like this will be in the list: ((-1 . <Entity name: 7eeb0530>)
(0 . "VLO-VL")
(5 . "19E")
(102 . "{ACAD_REACTORS")
(330 . <Entity name: 7eeb0500>)
(102 . "}")
(330 . <Entity name: 7eeb0500>)
(100 . "vlo_VL")
(90 . -64512)
(91 . 179)
(92 . 4)
(340 . <Entity name: 7eeb04f0>)
(340 . <Entity name: 7eeb04d8>)
(340 . <Entity name: 7eeb0520>)
(340 . <Entity name: 7eeb0518>)
(300
.
"((&VLO-C Object-Reactor ((:VLR-modified . \"MODIFIED\")) ((&VLO-A . 0)) ((&VLO-A . 1)) 0 T) (&VLO-C Object-Reactor ((:VLR-modified . \"MODIFIED\")) ((&VLO-A . 2)) ((&VLO-A . 3)) 0 T))"))
Just study those values and you can get all the data necessary... hope that now it will really going to help, not just the vs (with b) posted before by me earlier... :oops:
-
Thanks Luis - I don't know how you managed to find it, but well done - I'll have a play around with it and investigate 8-)
-
Nevermind, that doesn't work either...
(rwiz-partof (vlax-ename->vla-object (ssname (ssget '((0 . "VIEWPORT"))) 0)))
and my last try...
circle, lwpolyline...
_$ (setq ent (ssname (ssget '((0 . "VIEWPORT"))) 0))
_$ (vla-get-clipped (vlax-ename->vla-object ent))
:vlax-true
viewport...
_$ (setq ent (ssname (ssget '((0 . "VIEWPORT"))) 0))
_$ (vla-get-clipped (vlax-ename->vla-object ent))
:vlax-false
or to check the value of 90 dxf