Hey now I didn't say VBA was too hard, it is if you haven't had the time to
jump into it. Lisp isn't really hard either once you've learned it, neither
is driving, walking, using Autocad or talking. You don't have to sell me on
VBA, I'm just haven't had the time to do lisp much less learn VBA. Sorry if
I'm ranting, I've got a newborn.
😉
I'm trying to update my leader routine to scan the layer key and give the
user the option to choose a layer from their current layer key. It works
fine in 2i and 3 but if it's a new drawing in 2, my routine crashes because
it's trying to put nil into a dialog box. Right now I've added a check to
put an UNAVAILABLE in if my code returns nil.
Example of returned list before SAVING, CLOSING AND REOPENING:
((-1 .
) (0 . "AEC_VARS_ARCHBASE") (5 . "A7") (102 .
"{ACAD_REACTORS") (330 . ) (102 . "}") (330 .
name: 1519558>) (100 . "AecDbObject") (102 . "{AEC_SUBOBJECT") (300 .
"AecImpDictRecord") (100 . "AecImpObj") (3 . "") (100 . "AecImpDictRecord")
(102 . "AEC_SUBOBJECT}") (102 . "{AEC_NULLOBJECT}") (100 .
"AecDbDictRecord")
(100 . "AecDbVars") (100 . "AecDbVarsArchBase") (270 . 0) (70 . 0) (71 . 1)
(72
. 0) (73 . 0) (74 . 0) (75 . 0) (76 . 0) (77 . 0) (40 . 10.0) (41 . 40.0)
(42 .
6.0) (43 . 2.0) (44 . 34.0) (45 . 42.0) (46 . 6.0) (47 . 7.0) (48 . 4.0) (49
.
24.0) (50 . 11.0) (51 . 14.0))
Example of returned list after SAVING, CLOSING AND REOPENING:
((-1 . ) (0 . "AEC_VARS_DWG_SETUP") (5 . "2F0") (102 .
"{ACAD_REACTORS") (330 . ) (102 . "}") (330 .
name: 16a2630>) (100 . "AecDbObject") (102 . "{AEC_SUBOBJECT") (300 .
"AecImpDictRecord") (100 . "AecImpObj") (3 . "") (100 . "AecImpDictRecord")
(102 . "AEC_SUBOBJECT}") (102 . "{AEC_NULLOBJECT}") (100 .
"AecDbDictRecord")
(100 . "AecDbVars") (100 . "AecDbVarsDwgSetup") (70 . 1) (71 . 31) (72 . 4)
(73
. 4) (74 . 0) (75 . 0) (76 . 2) (77 . 2) (78 . 4) (79 . 2) (10 0.0 0.0 0.0)
(11
0.0 0.0 0.0) (50 . 0.0) (40 . 1.0) (41 . 1.0) (42 . 0.09375) (44 . 0.0625)
(45
. 96.0) (46 . 0.3048) (90 . 0) (91 . 4096) (92 . 0) (270 . 56) (271 . 2)
(272 .
130) (273 . 2) (2 . " Sq.Ft.") (3 . " Cu.Ft.") (4 . "ACADARCH") (6 . "L120")
(7
. "'") (8 . "m") (330 . ) (9 . "SUDA Layers") (43 .
0.5)
(5 . "C:\\Program Files\\AutoCAD Architectural
2\\Content\\Layers\\AecLayerStd.dwg"))
I will admit that this isn't important for my office much longer as we are
going to be moving to 3.3 after the current project is done, but for reasons
of compatibility, I would really like to understand my flaw.
thanks
CJ
"Peter Funk - Autodesk, Inc" wrote in message
news:9051B7545F42DBE6BF637E55617A16EF@in.WebX.maYIadrTaRb...
> CJ,
>
> I'm not sure why, what is the error you are getting... It could be that we
> changed the DXF code that is used. Post the list that you get before the
> assoc 9.
>
> By the way... Why are you LISP'ers using the getting the first element
(car)
> of a reversed list? Why don't you use "Last"???
>
> (setq lk (cdr (assoc 9 (entget (cdr (last (dictsearch
(namedobjdict))))))))
>
> and you say VBA is too hard
>
> Cheers,
>
> Peter Funk
> API Product Manager
> Building Industry Division
> Autodesk, Inc.
>
> "CJ Follmer" wrote in message
> news:17BA47675C827136C7D6EE890696A795@in.WebX.maYIadrTaRb...
> > On a new drawing, why in ADT 2 will this not work even after setting the
> > layerkey
> >
> > (setq lk (cdr (assoc 9 (entget (cdr (car (reverse (dictsearch
> (namedobjdict)
> > "aec_vars"))))))))
> >
> > until you save the drawing, close it and reopen it??
> >
> >
> > ADT 2i and 3.3 it works fine. It is really frustrating me!
> >
> > CJ
> >
> >
>
>