Discussion:
Problems with (vla-select ...)
(too old to reply)
Alexander V. Koshman
2003-12-16 10:41:33 UTC
Permalink
Hello NG!
-------------
I want to try to work with ActiveX part of VLISP and can't achieve
success...
I have to realize ActiveX variant of:

;;; (setq ss (ssget "x" '((8 . "Layer1"))))

And AutoCAD selects ALL the objects and doesn't filter them!
What I do wrong???


(setq acad (vlax-get-Acad-Object))
(setq doc (vla-get-ActiveDocument acad))
(setq ss (vla-add (vla-get-SelectionSets doc) "temp_ss"))
(vla-select ss acSelectionSetAll
(vlax-SafeArray-Fill (vlax-Make-SafeArray vlax-vbInteger (cons 0 0))
(list
8))
(vlax-SafeArray-Fill (vlax-Make-SafeArray vlax-vbVariant (cons 0 0))
(list
"Layer1"))
) ; - 'vla-select'
(alert (strcat "Number of objects: " (itoa (vla-get-Count ss))))

----------------------------
Alexander V. Koshman
Alexander V. Koshman
2003-12-16 12:18:08 UTC
Permalink
Oh my God!
---------------------

I found it!

Reply From: Bell, R. Robert
Date: Aug/06/03 - 17:07 (GMT)
Re: AcSelectionSetAll Method

***********************************
Great thanks to you Robert!!!
***********************************

;;; =============================================================
(setq ss (vla-add (vla-get-SelectionSets doc) "temp_ss"))

(vla-select ss acSelectionSetAll

nil ; - 'for OPTIONAL Point1' ; )

nil ; - 'for OPTIONAL Point2' ; )

(vlax-SafeArray-Fill (vlax-Make-SafeArray vlax-vbInteger (cons 0 0)) (list
60))

(vlax-SafeArray-Fill (vlax-Make-SafeArray vlax-vbVariant (cons 0 0)) (list
1))

) ; - 'vla-select'
;;; =============================================================

Thanks again to everybody for your time
and your hard labour of asking and aswering! : )
-----------------------------------------------------------------------------
Alexander V. Koshman
R. Robert Bell
2003-12-18 16:18:10 UTC
Permalink
Glad I could help (again!) <vbg>
--
R. Robert Bell, MCSE
www.AcadX.com


"Alexander V. Koshman" <***@mail.ru> wrote in message news:***@statler...
Oh my God!
---------------------

I found it!

Reply From: Bell, R. Robert
Date: Aug/06/03 - 17:07 (GMT)
Re: AcSelectionSetAll Method

***********************************
Great thanks to you Robert!!!
***********************************
unknown
2003-12-16 14:29:08 UTC
Permalink
This is the way that I ended up working with ActiveX selection sets in
vlisp.

(setq ss (ssget "x" '((8 . "Layer1"))))

(if ss
(setq vlaSS
(vla-get-ActiveSelectionSet
(vla-get-activeDocument
(vlax-get-acad-object)
)
)
)
)
--
Bobby C. Jones
www.AcadX.com
Post by Alexander V. Koshman
Hello NG!
-------------
I want to try to work with ActiveX part of VLISP and can't achieve
success...
;;; (setq ss (ssget "x" '((8 . "Layer1"))))
And AutoCAD selects ALL the objects and doesn't filter them!
What I do wrong???
(setq acad (vlax-get-Acad-Object))
(setq doc (vla-get-ActiveDocument acad))
(setq ss (vla-add (vla-get-SelectionSets doc) "temp_ss"))
(vla-select ss acSelectionSetAll
(vlax-SafeArray-Fill (vlax-Make-SafeArray vlax-vbInteger (cons 0 0))
(list
8))
(vlax-SafeArray-Fill (vlax-Make-SafeArray vlax-vbVariant (cons 0 0))
(list
"Layer1"))
) ; - 'vla-select'
(alert (strcat "Number of objects: " (itoa (vla-get-Count ss))))
----------------------------
Alexander V. Koshman
Alexander V. Koshman
2003-12-16 15:36:38 UTC
Permalink
Yes!
--------
Thank you Bobby for an another way!

And how about simply

(setq ss (ssget "x" '((8 . "Layer1"))))

and then

(vlax-ename->vla-object ...)

?

Will there be problems using the selection sets
made with (ssget ...) in the reactors callback functions?

------------------------------------

Alexander V. Koshman






"Bobby C. Jones" <bobbyj (at) acadx (dot) com> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ
Post by unknown
This is the way that I ended up working with ActiveX selection sets in
vlisp.
(setq ss (ssget "x" '((8 . "Layer1"))))
(if ss
(setq vlaSS
(vla-get-ActiveSelectionSet
(vla-get-activeDocument
(vlax-get-acad-object)
)
)
)
)
--
Bobby C. Jones
www.AcadX.com
Post by Alexander V. Koshman
Hello NG!
-------------
I want to try to work with ActiveX part of VLISP and can't achieve
success...
;;; (setq ss (ssget "x" '((8 . "Layer1"))))
And AutoCAD selects ALL the objects and doesn't filter them!
What I do wrong???
(setq acad (vlax-get-Acad-Object))
(setq doc (vla-get-ActiveDocument acad))
(setq ss (vla-add (vla-get-SelectionSets doc) "temp_ss"))
(vla-select ss acSelectionSetAll
(vlax-SafeArray-Fill (vlax-Make-SafeArray vlax-vbInteger (cons 0 0))
(list
8))
(vlax-SafeArray-Fill (vlax-Make-SafeArray vlax-vbVariant (cons 0 0))
(list
"Layer1"))
) ; - 'vla-select'
(alert (strcat "Number of objects: " (itoa (vla-get-Count ss))))
----------------------------
Alexander V. Koshman
unknown
2003-12-16 16:55:26 UTC
Permalink
Hi Alexander,
Yes, it is possible to iterate the lisp selection set and get the ActiveX
wrapper for each object within like you've shown. I personally prefer to
grab the ActiveX selection set and iterate it with the (vlax-for...)
statement though. That just comes down to a personal preference IMHO and I
don't see a problem with either method.

The act of creating selections sets with (ssget...) in and of itself
shouldn't cause problems in your callback functions.

Hope that helps!
--
Bobby C. Jones
www.AcadX.com
Post by Alexander V. Koshman
Yes!
--------
Thank you Bobby for an another way!
And how about simply
(setq ss (ssget "x" '((8 . "Layer1"))))
and then
(vlax-ename->vla-object ...)
?
Will there be problems using the selection sets
made with (ssget ...) in the reactors callback functions?
------------------------------------
Alexander V. Koshman
"Bobby C. Jones" <bobbyj (at) acadx (dot) com> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ
Post by unknown
This is the way that I ended up working with ActiveX selection sets in
vlisp.
(setq ss (ssget "x" '((8 . "Layer1"))))
(if ss
(setq vlaSS
(vla-get-ActiveSelectionSet
(vla-get-activeDocument
(vlax-get-acad-object)
)
)
)
)
--
Bobby C. Jones
www.AcadX.com
Post by Alexander V. Koshman
Hello NG!
-------------
I want to try to work with ActiveX part of VLISP and can't achieve
success...
;;; (setq ss (ssget "x" '((8 . "Layer1"))))
And AutoCAD selects ALL the objects and doesn't filter them!
What I do wrong???
(setq acad (vlax-get-Acad-Object))
(setq doc (vla-get-ActiveDocument acad))
(setq ss (vla-add (vla-get-SelectionSets doc) "temp_ss"))
(vla-select ss acSelectionSetAll
(vlax-SafeArray-Fill (vlax-Make-SafeArray vlax-vbInteger (cons 0 0))
(list
8))
(vlax-SafeArray-Fill (vlax-Make-SafeArray vlax-vbVariant (cons 0 0))
(list
"Layer1"))
) ; - 'vla-select'
(alert (strcat "Number of objects: " (itoa (vla-get-Count ss))))
----------------------------
Alexander V. Koshman
Alexander V. Koshman
2003-12-16 19:47:28 UTC
Permalink
Thank you Bobby for your help and good news! ; )
-------------------------------------------------------
Alexander V. Koshman
Loading...