Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Autolisp help: (Vla-intersectwith) and (vlax-safearray->list)

360 views
Skip to first unread message

Giovanni Anzani

unread,
Apr 8, 2002, 9:55:48 AM4/8/02
to
please help me!
E) Sorry, I don't speak english.
F) Je parle francais.
I) Parlo italiano
;---------------------------------------------------------------------
(defun c:ie ( / x-obj1 x-obj2)
;---------------------------------------------------------------------
;; OK Load ActiveX support
(vl-load-com)
;; OK Select object (entity)
;; and Transforms entity to VLA-object
(setq x-obj1 (vlax-ename->vla-object (car(entsel "\nSelect first
object:"))))
(setq x-obj2 (vlax-ename->vla-object (car(entsel "\nSelect second
object:"))))
;; OK Gets the points where 1° obj intersects 2° obj in the drawing.
Options:
;; acExtendNone Does not extend either obj.
;; acExtendThisEntity Extends the base obj.
;; acExtendOtherEntity Extends the obj passed as an argument.
;; acExtendBoth Extends both obj.
(setq x-var (VLA-INTERSECTWITH x-obj1 x-obj2 acExtendNone))
;---------------------------------------------------------------------
; QUESTION: If the two objects do not intersect, no data is returned;
; please help me to prevent error!!
;---------------------------------------------------------------------
; this always OK
; OK Determines the data type of a variant
(setq var_type (vlax-variant-type x-var))
; OK Returns the value of a variant -> diventa cosi' un safearray
(setq var_value (vlax-variant-value x-var))
; OK Returns the data type of a safearray
(setq sar_type (vlax-safearray-type var_value))
; OK Returns the number of dimensions in a safearray object
(setq sar_value (vlax-safearray-get-dim var_value))
;---------------------------------------------------------------------
;this, If the two objects do not intersect, BAD
; Message: -> error: bad argument type: safearrayp nil
; BAD Returns an element from an array
(setq se (vlax-safearray-get-element vv 0))
; BAD Returns the elements of a safearray in list form
(setq sl (vlax-safearray->list vv))
;---------------------------------------------------------------------
(alert " W ! The program is able to continue ! " )
) ;end defun c:ie
;---------------------------------------------------------------------
tia from Italy (Florence) Giovanni Anzani

R. Robert Bell

unread,
Apr 8, 2002, 10:34:27 AM4/8/02
to
Look at the (vl-Catch-All-Apply) function.

--
R. Robert Bell, MCSE
www.AcadX.com


"Giovanni Anzani" <giova...@tiscalinet.it> wrote in message
news:FD38262068A6BECD...@in.WebX.maYIadrTaRb...

Jürg Menzi

unread,
Apr 8, 2002, 2:16:13 PM4/8/02
to
Giovanni

Des traductions sont possibles avec cette homepage:
http://babelfish.altavista.com

Pour une solution de ton problème, tu peus visiter mon homepage:
-> Free Stuff -> Recherche pour 'VxGetInters'

Cheers
--
Juerg Menzi
MENZI ENGINEERING GmbH, Switzerland
http://www.menziengineering.ch

Domenico Maria Pisano

unread,
Apr 8, 2002, 4:47:48 PM4/8/02
to
Ciao Giovanni.
Sono Domenico da Matera.
Qualche mese fa abbiamo chiacchierato per telefono.
Chiedimi in privato ed in Italiano,
che cosa vuoi.
Ciao
Domenico

Giovanni Anzani <giova...@tiscalinet.it> wrote in message
news:FD38262068A6BECD...@in.WebX.maYIadrTaRb...

Giovanni Anzani

unread,
Apr 10, 2002, 8:21:37 AM4/10/02
to
Ciao Domenico Maria Pisano

> Ciao Giovanni.
> Sono Domenico da Matera.
> Qualche mese fa abbiamo chiacchierato per telefono.
> Chiedimi in privato ed in Italiano, che cosa vuoi.

Ho nel frattempo ricevuto la tua soluzione,
grazie, ci sentiamo in privato.
Ciao Giovanni


Giovanni Anzani

unread,
Apr 10, 2002, 8:36:40 AM4/10/02
to
Vladimir Nesterovsky

You write:
;------------------------------------------------------------------
Re: safearray value
;------------------------------------------------------------------
(defun lisp-value (v) ; the Holy Graal of vla->lisp conversion? ;-)
;; Copyright 2002 Vladimir Nesterovsky.
;; Free for use by any commercial entity with
;; less then $100 million annual revenue.
(cond
((= (type v) 'variant) (lisp-value (variant-value v)))
((= (type v) 'safearray) (mapcar 'lisp-value (safearray-value v)))
(T v)))
;------------------------------------------------------------------
(lisp-value v) solve my question.


Sorry, I don't speak english.

Ciao from Italy


Giovanni Anzani

unread,
Apr 10, 2002, 8:20:18 AM4/10/02
to
Jürg,

> Pour une solution de ton problème, tu peus visiter mon homepage:
> -> Free Stuff -> Recherche pour 'VxGetInters'
Je suis reussi à resoudre mon problème, mais je voudrais egalement
visitar l'homepage http://www.menziengineering.ch .
Malereusement, elle ne marche pas, ou moins les deux fois que j'ai
cherche' de l'ouvrir.
Excuse mon francais ecrit.
Je te remercie Salut Giovanni


Giovanni Anzani

unread,
Apr 10, 2002, 8:22:47 AM4/10/02
to
Robert,

> Look at the (vl-Catch-All-Apply) function.

Tanks Giovanni A


0 new messages