Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Explode method on MINSERTs ???

9 REPLIES 9
Reply
Message 1 of 10
Anonymous
1270 Views, 9 Replies

Explode method on MINSERTs ???

Should work if you trust vlax-method-applicable-p (I don't think you
should).

For example:
_$ (setq im (vlax-ename->vla-object (car(entsel))))
#
_$ (vlax-method-applicable-p im 'Explode)
T
_$ (vla-explode im)
; error: Automation Error. Cannot explode entity
_$ (vlax-invoke-method im 'Explode)
; error: Automation Error. Cannot explode entity

Is it just another bug, or I'm missing something?
TIA,

--
Reinaldo Togores
Graphics Expression in Engineering-CAD Research Group
University of Cantabria, Spain.
Personal WebSite: http://personales.unican.es/togoresr/
9 REPLIES 9
Message 2 of 10
Anonymous
in reply to: Anonymous

"R. Togores" wrote in message
news:6BF8895572DA7346778FD015FB07A2F4@in.WebX.maYIadrTaRb...
> Should work if you trust vlax-method-applicable-p (I don't think you
> should).
>
> For example:
> _$ (setq im (vlax-ename->vla-object (car(entsel))))
> #
> _$ (vlax-method-applicable-p im 'Explode)
> T
> _$ (vla-explode im)
> ; error: Automation Error. Cannot explode entity
> _$ (vlax-invoke-method im 'Explode)
> ; error: Automation Error. Cannot explode entity
>
> Is it just another bug, or I'm missing something?
> TIA,
>
> --
> Reinaldo Togores
> Graphics Expression in Engineering-CAD Research Group
> University of Cantabria, Spain.
> Personal WebSite: http://personales.unican.es/togoresr/
>
>

Reinaldo,

Aunque en el manual dice que si es posible explotar "minsert block" via
vla-explode, no es posible ya que se contradice si lees lo correspondiente
al comando explode y la parte referente a minsert's.

Saludos,
Luis.

Even if the method is available and return T, Blocks inserted using MINSERT
cannot be exploded.
Message 3 of 10
Anonymous
in reply to: Anonymous

I think that it inherits the explode method, because it is an insert, but
minserts can not be exploded. Bug, maybe. Help file omission, definitely.
--
Bobby C. Jones

"R. Togores" wrote in message
news:6BF8895572DA7346778FD015FB07A2F4@in.WebX.maYIadrTaRb...
> Should work if you trust vlax-method-applicable-p (I don't think you
> should).
>
> For example:
> _$ (setq im (vlax-ename->vla-object (car(entsel))))
> #
> _$ (vlax-method-applicable-p im 'Explode)
> T
> _$ (vla-explode im)
> ; error: Automation Error. Cannot explode entity
> _$ (vlax-invoke-method im 'Explode)
> ; error: Automation Error. Cannot explode entity
>
> Is it just another bug, or I'm missing something?
> TIA,
>
> --
> Reinaldo Togores
> Graphics Expression in Engineering-CAD Research Group
> University of Cantabria, Spain.
> Personal WebSite: http://personales.unican.es/togoresr/
>
>
Message 4 of 10
Anonymous
in reply to: Anonymous

Gracias, Luis.
Me había saltado esa parte.
Decididamente, vlax-method-applicable-p sirve de bien poco.
Un saludo,
Reinaldo

"Luis Esquivel" escribió en el mensaje
news:2D6D8729A355F4A6C113459BC259B167@in.WebX.maYIadrTaRb...
>
> "R. Togores" wrote in message
> news:6BF8895572DA7346778FD015FB07A2F4@in.WebX.maYIadrTaRb...
> > Should work if you trust vlax-method-applicable-p (I don't think you
> > should).
> >
> > For example:
> > _$ (setq im (vlax-ename->vla-object (car(entsel))))
> > #
> > _$ (vlax-method-applicable-p im 'Explode)
> > T
> > _$ (vla-explode im)
> > ; error: Automation Error. Cannot explode entity
> > _$ (vlax-invoke-method im 'Explode)
> > ; error: Automation Error. Cannot explode entity
> >
> > Is it just another bug, or I'm missing something?
> > TIA,
> >
> > --
> > Reinaldo Togores
> > Graphics Expression in Engineering-CAD Research Group
> > University of Cantabria, Spain.
> > Personal WebSite: http://personales.unican.es/togoresr/
> >
> >
>
> Reinaldo,
>
> Aunque en el manual dice que si es posible explotar "minsert block" via
> vla-explode, no es posible ya que se contradice si lees lo correspondiente
> al comando explode y la parte referente a minsert's.
>
> Saludos,
> Luis.
>
> Even if the method is available and return T, Blocks inserted using
MINSERT
> cannot be exploded.
>
>
Message 5 of 10
Anonymous
in reply to: Anonymous

MInserts have never been able to be exploded, so this is as designed
behavior.

"Bobby Jones" wrote in message
news:0EB4947F3045895DFF6F3019BDA21781@in.WebX.maYIadrTaRb...
> I think that it inherits the explode method, because it is an insert, but
> minserts can not be exploded. Bug, maybe. Help file omission,
definitely.
> --
> Bobby C. Jones
>
> "R. Togores" wrote in message
> news:6BF8895572DA7346778FD015FB07A2F4@in.WebX.maYIadrTaRb...
> > Should work if you trust vlax-method-applicable-p (I don't think you
> > should).
> >
> > For example:
> > _$ (setq im (vlax-ename->vla-object (car(entsel))))
> > #
> > _$ (vlax-method-applicable-p im 'Explode)
> > T
> > _$ (vla-explode im)
> > ; error: Automation Error. Cannot explode entity
> > _$ (vlax-invoke-method im 'Explode)
> > ; error: Automation Error. Cannot explode entity
> >
> > Is it just another bug, or I'm missing something?
> > TIA,
> >
> > --
> > Reinaldo Togores
> > Graphics Expression in Engineering-CAD Research Group
> > University of Cantabria, Spain.
> > Personal WebSite: http://personales.unican.es/togoresr/
> >
> >
>
>
Message 6 of 10
Anonymous
in reply to: Anonymous

I agree. I said maybe a bug, because the vlax-method-applicable-p should
return nil on a minsert instead of T. But it's definitely a shortcoming of
the help files to list the explode method as available to a minsert, when
clearly it is not. Does anyone know if this is fixed in TuTu?
--
Bobby C. Jones

"Art Cooney" wrote in message
news:C130F472F015CE870329AE48900162CB@in.WebX.maYIadrTaRb...
> MInserts have never been able to be exploded, so this is as designed
> behavior.
Message 7 of 10
Anonymous
in reply to: Anonymous

Definitely vlax-method-applicable-p is a sorry contraption.
¿What's the use of a predicate if it you can't trust it?
Other example: GetBoundingBox on rays and xlines,
vlax-method-applicable-p will also return True on this objects
when clearly it is not applicable.
Although in this case the method should really be applicable and could
return 1.#INF,
as Reini Urban once suggested, which is the (also undocumented)
representation of
INFINITE (real number overflow)...
(try some real big number like 1.0e+310, you'll get 1.#INF)
Reinaldo

"Bobby Jones" escribió en el mensaje
news:FE80702D9DFD416F3A3C6CE47E7A87EF@in.WebX.maYIadrTaRb...
> I agree. I said maybe a bug, because the vlax-method-applicable-p should
> return nil on a minsert instead of T. But it's definitely a shortcoming
of
> the help files to list the explode method as available to a minsert, when
> clearly it is not. Does anyone know if this is fixed in TuTu?
> --
> Bobby C. Jones
>
> "Art Cooney" wrote in message
> news:C130F472F015CE870329AE48900162CB@in.WebX.maYIadrTaRb...
> > MInserts have never been able to be exploded, so this is as designed
> > behavior.
>
>
>
Message 8 of 10
Anonymous
in reply to: Anonymous

The predicate can be trusted. The object has an exposed explode method.

vlax-method-applicable-p returns true if the object has an exposed method
with the name you pass it. The minsert block object has an explode method.
You can call that method and the object will respond. In this case the
object returns an exception telling you it cannot be exploded. This is not
what you wanted but it is as designed.

It doesn't matter which automation controller you use VLISP, VBA, Delphi,
VB, C++, etc. Each one will show you the Explode method exists for
minserted block objects and each one will return an exception when that
method is called.

You can code around the exception using vl-catch-all-apply.

(setq im (vlax-ename->vla-object (car (entsel))))
(if (vlax-method-applicable-p im 'Explode)
(progn
(setq retval (vl-catch-all-apply 'vlax-invoke-method (list im
'Explode)))
(if (vl-catch-all-error-p retval)
(list "Explode" im (vl-catch-all-error-message retval))))
)

The documentation should point out that Explode does not apply for this
object. I don't know if the documentation has been updated in 2002 but I
can tell you that the minsert object still exposes an explode method and
still returns an exception if that method is called.

Steve Mighetto

"R. Togores" wrote in message
news:5312FF67E7C4C8DBA9F78B38D1606375@in.WebX.maYIadrTaRb...
> Definitely vlax-method-applicable-p is a sorry contraption.
> ¿What's the use of a predicate if it you can't trust it?
> Other example: GetBoundingBox on rays and xlines,
> vlax-method-applicable-p will also return True on this objects
> when clearly it is not applicable.
> Although in this case the method should really be applicable and could
> return 1.#INF,
> as Reini Urban once suggested, which is the (also undocumented)
> representation of
> INFINITE (real number overflow)...
> (try some real big number like 1.0e+310, you'll get 1.#INF)
> Reinaldo
>
> "Bobby Jones" escribió en el mensaje
> news:FE80702D9DFD416F3A3C6CE47E7A87EF@in.WebX.maYIadrTaRb...
> > I agree. I said maybe a bug, because the vlax-method-applicable-p
should
> > return nil on a minsert instead of T. But it's definitely a shortcoming
> of
> > the help files to list the explode method as available to a minsert,
when
> > clearly it is not. Does anyone know if this is fixed in TuTu?
> > --
> > Bobby C. Jones
> >
> > "Art Cooney" wrote in message
> > news:C130F472F015CE870329AE48900162CB@in.WebX.maYIadrTaRb...
> > > MInserts have never been able to be exploded, so this is as designed
> > > behavior.
> >
> >
> >
>
>
Message 9 of 10
Anonymous
in reply to: Anonymous

What you can do is copy the appropiate information from the minsert and erase it and array the blocks to match the minsert. We used to copy electrical lighting arrays to minsert to reduce the size of drawings. Arrays have their use I guess but being able to copy them for a minsert and then being able to convert them back into a array is really usefull.
Dave Alexander
Message 10 of 10
salukowski
in reply to: Anonymous

Use the block editor, copy to clipboard with a base point, open new drawing, paste to original coordinates.  The new file will not have the minsert and acts just a normal cad file.  No need for hacking.  This works in Autocad 2013; I don't know about earlier versions.  I hope this helps.

 

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

Post to forums  

Autodesk Design & Make Report

”Boost