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:
Routine hangs just a bit with text selection ListTiledepedencyV1-1.lsp
« previous
next »
Print
Pages: [
1
] |
Go Down
Author
Topic: Routine hangs just a bit with text selection ListTiledepedencyV1-1.lsp (Read 668 times)
0 Members and 1 Guest are viewing this topic.
jlogan02
Bull Frog
Posts: 327
Routine hangs just a bit with text selection ListTiledepedencyV1-1.lsp
«
on:
June 17, 2022, 12:47:48 PM »
Lee Mac helped me with this routine to insert blocks selected from a dual column dialog box. It's hanging ever so slightly after selecting the text to edit. Looking to see if anyone else is getting that same behavior.
I've provided a block "Approval-NA-SL" and the ListTileDependencyV1-1.lsp to go along with the quoted code in the post.
Code - Auto/Visual Lisp:
[Select]
(
defun
c:StampIns
(
/
*error*
osm dch dcl des str lst rtn ss hnd
)
(
defun
*error*
(
msg
)
(
if
(
=
'file
(
type
des
)
)
(
close
des
)
)
(
if
(
<
0
dch
)
(
unload_dialog
dch
)
)
(
if
(
and
(
=
'str
(
type
dcl
)
)
(
findfile
dcl
)
)
(
vl-file-delete
dcl
)
)
(
if
(
and
msg
(
not
(
wcmatch
(
strcase
msg t
)
"*break,*cancel*,*exit*"
)
)
)
(
princ
(
strcat
"
\n
Error: "
msg
)
)
)
(
princ
)
)
(
setq
lst
'
(
(
"Static"
(
"Approval-NA-SL"
"Approval-Schem-ACDC"
"Approval-NA-PLO"
"Approval-NA-ND"
"Note_RemRet"
"Note_RemOnly"
"Note_RefOnly"
"Note_RefDwgNum"
)
)
(
"User"
(
"Note_Rev_NewDwg"
"Note_Rev_ExistDwg"
"Note_Delta_Revision"
)
)
)
)
(
if
(
and
(
setq
dcl
(
vl-filename-mktemp
"tmp.dcl"
)
)
(
setq
des
(
open
dcl
"w"
)
)
(
foreach
str
'
(
"lbx : list_box"
"{"
" alignment = centered;"
" fixed_width = true;"
" fixed_height = true;"
" width = 30;"
" height = 15;"
"}"
"test : dialog"
"{"
" label =
\"
Annotation
\"
;"
" spacer;"
" : row"
" {"
" : lbx { key =
\"
lb0
\"
; label =
\"
Insert
\"
; }"
" : lbx { key =
\"
lb1
\"
; label =
\"
Annotation
\"
; }"
" }"
" spacer;"
" ok_cancel;"
"}"
)
(
write-line
str des
)
)
(
not
(
setq
des
(
close
des
)
)
)
(
<
0
(
setq
dch
(
load_dialog
dcl
)
)
)
(
new_dialog
"test"
dch
)
)
(
progn
(
setq
rtn '
(
0
0
)
)
(
LM:dcld:action '
(
"lb0"
"lb1"
)
'lst 'rtn
)
(
setq
Osm
(
getvar
'osmode
)
)
(
if
(
=
1
(
start_dialog
)
)
(
progn
(
setq
rtn
(
LM:dcld:getitems rtn lst
)
)
(
command
"osmode"
1
)
(
command
"_.-insert"
(
cadr
rtn
)
"_S"
(
getvar
'dimscale
)
"_R"
0.0
)
(
if
(
=
"Static"
(
car
rtn
)
)
(
command
"_non"
'
(
0
0
)
)
(
command
"
\\
"
)
)
(
command
"._explode"
"_l"
)
(
if
(
and
(
setq
ss
(
ssget
)
)
(
setq
i
-
1
)
)
(
repeat
(
sslength
ss
)
(
setq
hnd
(
ssname
ss
(
setq
i
(
1+
i
)
)
)
)
(
command
"_textedit"
hnd
""
)
)
)
)
)
(
command
"_change"
hnd
""
"P"
"C"
"1"
""
)
(
princ
"
\n
*Cancel*"
)
)
)
(
setvar
'osmode Osm
)
(
*error*
nil
)
(
princ
)
)
Command: Stampins
Select the Approval-NA-SL from the list
Text edit command launches
User edits the text
hits enter
Text changes from brown to red.
Logged
J. Logan
ACAD 2018
I am one with the Force and the Force is with me.
AutoCAD Map 2018 Windows 10
jlogan02
Bull Frog
Posts: 327
Re: Routine hangs just a bit with text selection ListTiledepedencyV1-1.lsp
«
Reply #1 on:
June 21, 2022, 03:41:01 PM »
May have solved the issue. I had a comment in my lisp description that didn't have the (;
in front of it. That particular line usually says ;;command: Stampins
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
] |
Go Up
« previous
next »
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
Routine hangs just a bit with text selection ListTiledepedencyV1-1.lsp