TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: lamarn on October 04, 2019, 07:59:26 AM
Title:
Change Flipstate for Scale X -1
Post by:
lamarn
on
October 04, 2019, 07:59:26 AM
Hi all,
What i want to accomplish is a routine that changes my dynamic block to "Flipped" if Scale X is -1.
Thanks for any input or references..
Title:
Re: Change Flipstate for Scale X -1
Post by:
Dlanor
on
October 04, 2019, 09:08:31 AM
Use Lee's dynamic block properties http://www.lee-mac.com/dynamicblockfunctions.html (http://www.lee-mac.com/dynamicblockfunctions.html)
Title:
Re: Change Flipstate for Scale X -1
Post by:
Lee Mac
on
October 04, 2019, 01:38:48 PM
Quickly written -
Code - Auto/Visual Lisp:
[Select]
(
defun
c:test
(
/
f i o s
)
(
if
(
setq
s
(
ssget
"_:L"
'
(
(
0
.
"INSERT"
)
)
)
)
(
repeat
(
setq
i
(
sslength
s
)
)
(
setq
i
(
1-
i
)
o
(
vlax
-
ename
->
vla-object
(
ssname
s i
)
)
f
(
if
(
minusp
(
vla
-
get
-
xeffectivescalefactor o
)
)
1
0
)
)
(
foreach
p
(
vlax-invoke
o 'getdynamicblockproperties
)
(
if
(
equal
'
(
0
1
)
(
vlax-get
p 'allowedvalues
)
)
;; likely to be a flip parameter
(
vla
-
put
-
value p
(
vlax
-
make
-
variant
f
vlax-vbinteger
)
)
)
)
)
)
(
princ
)
)
Could be optimised to target specific blocks or a named dynamic flip parameter.
Title:
Re: Change Flipstate for Scale X -1
Post by:
lamarn
on
October 04, 2019, 06:06:15 PM
That is amazing.
I can write some code but not like that.
Thanks!!