Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Login
Register
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
LM:SentenceCase Use in routine
« previous
next »
Print
Pages:
1
[
2
]
All
|
Go Down
Author
Topic: LM:SentenceCase Use in routine (Read 4553 times)
0 Members and 1 Guest are viewing this topic.
kdub_nz
Mesozoic keyThumper
SuperMod
Water Moccasin
Posts: 1900
class keyThumper<T>:ILazy<T>
Re: LM:SentenceCase Use in routine
«
Reply #15 on:
November 22, 2022, 05:04:48 PM »
For Properties Filter :
consecutive changes => ok
I'll have a look at the Groups . .
Logged
Called Kerry in my other life
Retired; but they dragged me back in !
I live at UTC + 13.00
some people complain about loading the dishwasher
Sometimes the question is more important than the answer.
kdub_nz
Mesozoic keyThumper
SuperMod
Water Moccasin
Posts: 1900
class keyThumper<T>:ILazy<T>
Re: LM:SentenceCase Use in routine
«
Reply #16 on:
November 22, 2022, 05:25:17 PM »
@jlogan02,
You're correct.
The Group filters can be changed from the 'Rename' in the Layer Properties Manager,
and from the command Line manually,
but NOT using the function
I'll have a better look tonight.
Logged
Called Kerry in my other life
Retired; but they dragged me back in !
I live at UTC + 13.00
some people complain about loading the dishwasher
Sometimes the question is more important than the answer.
kdub_nz
Mesozoic keyThumper
SuperMod
Water Moccasin
Posts: 1900
class keyThumper<T>:ILazy<T>
Re: LM:SentenceCase Use in routine
«
Reply #17 on:
November 22, 2022, 05:40:50 PM »
Looks like the Group data is kept somewhere else than theDictionary attached to the Table !!
added:
Unless the report from
MgdDbg
snoop is incomplete ??
«
Last Edit: November 22, 2022, 05:50:04 PM by kdub
»
Logged
Called Kerry in my other life
Retired; but they dragged me back in !
I live at UTC + 13.00
some people complain about loading the dishwasher
Sometimes the question is more important than the answer.
jlogan02
Bull Frog
Posts: 327
Re: LM:SentenceCase Use in routine
«
Reply #18 on:
November 22, 2022, 06:52:55 PM »
ACLYDICTIONARY
Code - Auto/Visual Lisp:
[Select]
(
defun
:LayerFilterList
(
/
:SubFilterList
)
; su returns list of main filter and sub filters right behind
(
defun
:SubFilterList
(
dict
/
ent lst
)
(
foreach
ent
(
mapcar
'
cdr
(
vl
-
remove
-
if
-
not
'
(
lambda
(
x
)
(
=
(
car
x
)
350
)
)
dict
)
)
(
setq
lst
(
append
lst
(
cons
ent
(
if
(
assoc
360
(
entget
ent
)
)
(
:SubFilterList
(
entget
(
cdr
(
assoc
360
(
entget
(
cdr
(
assoc
360
(
entget
ent
)
)
)
)
)
)
)
)
)
)
)
)
)
lst
)
(
mapcar
'
(
lambda
(
x
)
(
cdr
(
assoc
300
(
entget
x
)
)
)
)
(
:SubFilterList
(
dictsearch
(
vlax
-
vla
-
object
->
ename
(
vla-getextensiondictionary
(
vla-get-layers
(
vla-get-activedocument
(
vlax-get-acad-object
)
)
)
)
)
"ACLYDICTIONARY"
)
)
)
)
This returns the list of Property and Group filters.
https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layer-filter-existence-test/m-p/7910315#M367448
«
Last Edit: November 22, 2022, 07:13:51 PM by jlogan02
»
Logged
J. Logan
ACAD 2018
I am one with the Force and the Force is with me.
AutoCAD Map 2018 Windows 10
kdub_nz
Mesozoic keyThumper
SuperMod
Water Moccasin
Posts: 1900
class keyThumper<T>:ILazy<T>
Re: LM:SentenceCase Use in routine
«
Reply #19 on:
November 22, 2022, 11:23:18 PM »
Cool, That looks like it will return names of Properties, Groups and nested Filters.
Could solve most of your issues
I learnt something 'cause I've not played with these before.
Logged
Called Kerry in my other life
Retired; but they dragged me back in !
I live at UTC + 13.00
some people complain about loading the dishwasher
Sometimes the question is more important than the answer.
jlogan02
Bull Frog
Posts: 327
Re: LM:SentenceCase Use in routine
«
Reply #20 on:
November 23, 2022, 10:50:53 AM »
I'm going to whittle with it today and see what I come up with.
Logged
J. Logan
ACAD 2018
I am one with the Force and the Force is with me.
AutoCAD Map 2018 Windows 10
kdub_nz
Mesozoic keyThumper
SuperMod
Water Moccasin
Posts: 1900
class keyThumper<T>:ILazy<T>
Re: LM:SentenceCase Use in routine
«
Reply #21 on:
November 23, 2022, 12:37:49 PM »
@jlogan02.
Fairly clean from here.
run (:LayerFilterList) to determine the current complete filter list.
determine if the newName exists (position) or (member) in list
if so ; finished
determine if the 0ldName exists (position) or (member) in list
if so ; proceed
run the .-layer filter command as previously.
have a beer.
Regards,
stay well
Logged
Called Kerry in my other life
Retired; but they dragged me back in !
I live at UTC + 13.00
some people complain about loading the dishwasher
Sometimes the question is more important than the answer.
jlogan02
Bull Frog
Posts: 327
Re: LM:SentenceCase Use in routine
«
Reply #22 on:
November 23, 2022, 06:25:53 PM »
Took a little stab before calling it a day.
Keeps getting a nil.
Code - Auto/Visual Lisp:
[Select]
(
defun
C:LayerFilterList
(
/
:SubFilterList oldName newName
)
; su returns list of main filter and sub filters right behind
(
defun
:SubFilterList
(
dict
/
ent lst
)
(
foreach
ent
(
mapcar
'
cdr
(
vl
-
remove
-
if
-
not
'
(
lambda
(
x
)
(
=
(
car
x
)
350
)
)
dict
)
)
(
setq
lst
(
append
lst
(
cons
ent
(
if
(
assoc
360
(
entget
ent
)
)
(
:SubFilterList
(
entget
(
cdr
(
assoc
360
(
entget
(
cdr
(
assoc
360
(
entget
ent
)
)
)
)
)
)
)
)
)
)
)
)
)
lst
)
(
mapcar
'
(
lambda
(
x
)
(
cdr
(
assoc
300
(
entget
x
)
)
)
)
(
:SubFilterList
(
dictsearch
(
vlax
-
vla
-
object
->
ename
(
vla-getextensiondictionary
(
vla-get-layers
(
vla-get-activedocument
(
vlax-get-acad-object
)
)
)
)
)
"ACLYDICTIONARY"
)
)
)
)
(
setq
oldName
"Stations Standard Layer"
newName
"Stations Standard Layers"
)
(
if
(
member
newName lst
)
(
princ
"Stations Standard Layers already exists."
)
)
(
if
(
member
oldName lst
)
(
progn
(
command
"._-layer"
"filter"
"Rename"
oldName newName
""
)
)
)
Happy Thanksgiving. Back at it Monday.
Logged
J. Logan
ACAD 2018
I am one with the Force and the Force is with me.
AutoCAD Map 2018 Windows 10
kdub_nz
Mesozoic keyThumper
SuperMod
Water Moccasin
Posts: 1900
class keyThumper<T>:ILazy<T>
Re: LM:SentenceCase Use in routine
«
Reply #23 on:
November 23, 2022, 07:43:48 PM »
perhaps something like this
Code - Auto/Visual Lisp:
[Select]
;;===========================================================
(
defun
c:NewDoIt
(
/
oldName newName currentFilterList
)
(
setq
oldName
"Stations Standard Layer"
newName
"Stations Standard Layers"
currentFilterList
(
:LayerFilterList
)
)
(
if
(
vl-position
newname currentFilterList
)
(
princ
(
strcat
"
\n
\t
'"
newName
"' filter already exists."
)
)
;; else
(
if
(
vl-position
oldname currentFilterList
)
(
progn
(
command
"._-layer"
"filter"
"Rename"
oldName newName
""
)
(
princ
(
strcat
"
\n
\t
'"
oldName
"' filter changed to '"
newName
"'."
)
)
)
;;else
(
princ
(
strcat
"
\n
\t
'"
oldName
"' filter does not exists."
)
)
)
)
(
princ
)
)
;;===========================================================
(
defun
:LayerFilterList
(
/
:SubFilterList
)
; su returns list of main filter and sub filters right behind
(
defun
:SubFilterList
(
dict
/
ent lst
)
(
foreach
ent
(
mapcar
'
cdr
(
vl
-
remove
-
if
-
not
'
(
lambda
(
x
)
(
=
(
car
x
)
350
)
)
dict
)
)
(
setq
lst
(
append
lst
(
cons
ent
(
if
(
assoc
360
(
entget
ent
)
)
(
:SubFilterList
(
entget
(
cdr
(
assoc
360
(
entget
(
cdr
(
assoc
360
(
entget
ent
)
)
)
)
)
)
)
)
)
)
)
)
)
lst
)
(
mapcar
'
(
lambda
(
x
)
(
cdr
(
assoc
300
(
entget
x
)
)
)
)
(
:SubFilterList
(
dictsearch
(
vlax
-
vla
-
object
->
ename
(
vla-getextensiondictionary
(
vla-get-layers
(
vla-get-activedocument
(
vlax-get-acad-object
)
)
)
)
)
"ACLYDICTIONARY"
)
)
)
)
;;===========================================================
Enjoy your holiday.
Logged
Called Kerry in my other life
Retired; but they dragged me back in !
I live at UTC + 13.00
some people complain about loading the dishwasher
Sometimes the question is more important than the answer.
jlogan02
Bull Frog
Posts: 327
Re: LM:SentenceCase Use in routine
«
Reply #24 on:
November 29, 2022, 05:06:02 PM »
kdub, that did the trick. Made some minor adjustments to messaging but other than that, all is good. Thanks for your help. Much appreciated.
Logged
J. Logan
ACAD 2018
I am one with the Force and the Force is with me.
AutoCAD Map 2018 Windows 10
Print
Pages:
1
[
2
]
All
|
Go Up
« previous
next »
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
LM:SentenceCase Use in routine