TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: jmcshane on March 28, 2022, 11:59:17 AM
-
Hi guys,
Haven't posted here in a while. Just trying figure out if there is a way to get a list of layout tabs without using active X or the Layoutlist command.
Looking at doing some acoreconsole work and it doesn't handle activeX.
I am trying to delete layouts which don't have the same name as the drawing.
Would be grateful if someone could point me in the right direction.
Cheers
John
-
(dictsearch (namedobjdict) "ACAD_LAYOUT")
-
Oh now that's neat!!
Please excuse my next question as its been a few years since I coded properly and am a bit rusty.....
I was going to stick the result of this into a list and just delete whatever layout didn't match with a foreach loop, how can I just grab all the assoc 3 pairs?
Thanks in advance,
John
-
Oh now that's neat!!
Please excuse my next question as its been a few years since I coded properly and am a bit rusty.....
I was going to stick the result of this into a list and just delete whatever layout didn't match with a foreach loop, how can I just grab all the assoc 3 pairs?
Thanks in advance,
John
Just check within your loop like so:
-
Thanks a million Guys, that's exactly what I needed.
Really appreciate the help.
John
-
You could alternatively use dictnext in a manner analogous to how you might use tblnext to iterate over a symbol table, e.g.:
(defun mylayoutlist
( / dic itm rtn
) )
)
)
-
What is wrong with
-
What is wrong with
(LayoutList) works fine when used normally, but for some reason it wouldn't work when using acoreconsole.
I'm thinking it might be based on ActiveX which isn't supported in acoreconsole as far as I know.
Cheers,
John
-
You could alternatively use dictnext in a manner analogous to how you might use tblnext to iterate over a symbol table, e.g.:
(defun mylayoutlist
( / dic itm rtn
) )
)
)
Thanks Lee, you'll have to excuse my lack of knowledge here, but what benefits would this have over the other way?
Thanks in advance,
John
-
You could alternatively use dictnext in a manner analogous to how you might use tblnext to iterate over a symbol table, e.g.:
(defun mylayoutlist
( / dic itm rtn
) )
)
)
Thanks Lee, you'll have to excuse my lack of knowledge here, but what benefits would this have over the other way?
No particular benefit, just another way to skin the cat :-)
-
I'm thinking it might be based on ActiveX which isn't supported in acoreconsole as far as I know.
(layoutlist) is defined inside acapp.arx which is not loaded by acoreconsole
-
Thanks guys, really appreciate all the information and help.
John
-
I'm thinking it might be based on ActiveX which isn't supported in acoreconsole as far as I know.
(layoutlist) is defined inside acapp.arx which is not loaded by acoreconsole
So simply load it in the Script:
_.arx L "acapp.arx"
(setq foo (layoutlist))
Core Console supports loading ARX/.NET assemblies.
Cheers
-
Thanks BlackBox, I didn't know you could do that.