dotted pairs

dotted pairs

Anonymous
Not applicable
526 Views
5 Replies
Message 1 of 6

dotted pairs

Anonymous
Not applicable
Hi,
How does one access the dotted pairs that the ACAD2K objects do not have
properties or methods for. I am trying to read some viewport object
information in particular.
Thanks
JR
0 Likes
527 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
One way is to use VLAX.CLS. You can get a copy in the Downloads
section of my site. Once imported into your project, you can use code
similar to the following. To make this work, you'll also need the
listToVariantArray function from the VisualLISP section. Import the
class into your project, load listToVariantArray into the drawing and
execute (vl-load-com) at the command line (if necessary). Then run the
Test sub.

BTW, enames are converted to ObjectIds.

Public Sub GetEDD(ent As AcadEntity, gCodes, eData)

Dim obj As VLAX

Set obj = New VLAX
obj.EvalLispExpression "(setq lst (entget (handent """ &
ent.Handle & """)))"
gCodes = obj.EvalLispExpression("(listtovariantarray (mapcar 'car
lst) vlax-vbInteger)")
eData = obj.EvalLispExpression("(listtovariantarray (mapcar 'cdr
lst) vlax-vbVariant)")
obj.NullifySymbol "lst"

End Sub


Public Sub test()

Dim ent As AcadEntity, pt, g, e

ThisDrawing.Utility.GetEntity ent, pt, "Select object:"
Call GetEDD(ent, g, e)

For i = LBound(g) To UBound(g)
If VarType(e(i)) >= vbArray Then
tmp = ""
For j = LBound(e(i)) To UBound(e(i))
tmp = tmp & e(i)(j) & " "
Next
Else
tmp = e(i)
End If
Debug.Print g(i) & " . " & tmp
Next

End Sub


--
http://www.acadx.com


"JR Walker" wrote in message
news:4BB8969214C3B9A0BF7B05E22E698D80@in.WebX.maYIadrTaRb...
> Hi,
> How does one access the dotted pairs that the ACAD2K objects do not
have
> properties or methods for. I am trying to read some viewport object
> information in particular.
> Thanks
> JR
>
>
0 Likes
Message 3 of 6

Anonymous
Not applicable
PLEASE don't get angry with me Frank.

Could you possibly modify your VLAX routine (or create a parallel one) so
that I would not have to use LISP inside of VBA? That's why I learned VBA:
so I wouldn't have to learn Lisp!

Your EvalLispExpression arguments are still LISP and very confusing to me.
Undoubtedly, your routines are sweet, but I don't know lisp.

Could you write wrapper functions in VBA for every function I will probably
need so I could call the function using logical parameters, like YValue
rather than (caaddr (cdadar (list (caaaar (cddddr (cadadr card)))))))?
Oops! unbalanced parentheticals! 🙂

And while you don't have anything else to do, could you learn the MDT model
and break the secret code for the BRepAuto, GeAuto, and McadAuto
applications. You know I'll need wrapper functions for all those routines,
too. You just have to simplify these things for me. Ok?






Frank Oquendo wrote in message
news:3464DD9E48BEAA46EA6EDF71E2A246FD@in.WebX.maYIadrTaRb...
> One way is to use VLAX.CLS. You can get a copy in the Downloads
> section of my site. Once imported into your project, you can use code
> similar to the following. To make this work, you'll also need the
> listToVariantArray function from the VisualLISP section. Import the
> class into your project, load listToVariantArray into the drawing and
> execute (vl-load-com) at the command line (if necessary). Then run the
> Test sub.
>
> BTW, enames are converted to ObjectIds.
>
> Public Sub GetEDD(ent As AcadEntity, gCodes, eData)
>
> Dim obj As VLAX
>
> Set obj = New VLAX
> obj.EvalLispExpression "(setq lst (entget (handent """ &
> ent.Handle & """)))"
> gCodes = obj.EvalLispExpression("(listtovariantarray (mapcar 'car
> lst) vlax-vbInteger)")
> eData = obj.EvalLispExpression("(listtovariantarray (mapcar 'cdr
> lst) vlax-vbVariant)")
> obj.NullifySymbol "lst"
>
> End Sub
>
>
> Public Sub test()
>
> Dim ent As AcadEntity, pt, g, e
>
> ThisDrawing.Utility.GetEntity ent, pt, "Select object:"
> Call GetEDD(ent, g, e)
>
> For i = LBound(g) To UBound(g)
> If VarType(e(i)) >= vbArray Then
> tmp = ""
> For j = LBound(e(i)) To UBound(e(i))
> tmp = tmp & e(i)(j) & " "
> Next
> Else
> tmp = e(i)
> End If
> Debug.Print g(i) & " . " & tmp
> Next
>
> End Sub
>
>
> --
> http://www.acadx.com
>
>
> "JR Walker" wrote in message
> news:4BB8969214C3B9A0BF7B05E22E698D80@in.WebX.maYIadrTaRb...
> > Hi,
> > How does one access the dotted pairs that the ACAD2K objects do not
> have
> > properties or methods for. I am trying to read some viewport object
> > information in particular.
> > Thanks
> > JR
> >
> >
>
>
0 Likes
Message 4 of 6

Anonymous
Not applicable
> Could you possibly modify your VLAX routine
> (or create a parallel one) so that I would not have
> to use LISP inside of VBA?

Actually, you can do that sort of thing all on your own. For example,
the code in my previous post can be added to the VLAX class module
itself (since you have the source) to create a new method.

For access to a ton of missing properties in AutoCAD objects (with
nary a bit of LISP), have a look at vbXtender.arx. You'll find it in
the Downloads section of my site. It's both free and open source.

As for the rest of your post: don't make me come over there! ;^)

--
http://www.acadx.com
0 Likes
Message 5 of 6

Anonymous
Not applicable
Thanks, Frank.

I don't do C any more.

Between you and Randall Rath and a few others here, I guess I'll eventually
learn about class module programming.

Thanks,
0 Likes
Message 6 of 6

Anonymous
Not applicable
> I don't do C any more.

You ma have misunderstood: vbXtender is an ActiveX server designed
specifically for use with VB/VBA. Once you load it in AutoCAD, you
have access to a whole host of properties and methods not normally
available to VB.

--
http://www.acadx.com


"Keith" wrote in message
news:097BBE4B52578630F369153D110F11D7@in.WebX.maYIadrTaRb...
> Thanks, Frank.
>
> I don't do C any more.
>
> Between you and Randall Rath and a few others here, I guess I'll
eventually
> learn about class module programming.
>
> Thanks,
>
>
0 Likes