Betoniera
Guest
I made a small program called "description brackets.lsp" which simply pulls a line and writes a label.
utility lies in the fact that the label is editable in a dialog box and is therefore always available in memory, without having to type it every time.
very comfortable for repeat labels.
for this lisp I have to thank the forum because it has indicated how to use the dialog box.
for 3 years it always worked.
now gives me this error:
command: ; error: the activex server returned an error: error when loading the dll library of typeswould you tell me how to solve the problem?
I think it doesn't depend on the lisp because on other computers it works.
in any way I transmit the list of the lisp and the dcl pane
program lisp
;description staff.lsp
;autocad 2014 04-10-2013
(setq snp (getvar "snapmode")
ort (getvar "orthomode")
sc (getvar "dimscale")
)
(setvar "orthomode" 0)
(setvar "snapmode" 0)
(setq dcl_id (load_dialog "inputbox.dcl"))
(if (new_dialog "inputbox" dcl_id)
;;; (vl-exit-with-error (alert "the framework of dialogue not found!"))
(exit)
)
(if (equal (type hdesc) 'real)
(setq hdesc(rtos hdesc))
)
(if (not hdesc); imposed in the dcl the value of the text height
(set_tile "htesto" (setq hdesc "2.00"))
(set_tile "htesto" hdesc)
)
(if (not txt); imposed in dcl the value of the string
(set_tile "text" (setq txt "st %%c8/20"))
(set_tile "text" txt)
)
(action_tile "text" (setq txt $value));;; recovery string value
(action_tile "htesto" (setq hdesc $value));;; recovery the value of the text height
(action_tile "accept" (done_dialog 1))
(setq answer (start_dialog))
(unload_dialog dcl_id)
(if)
(progn)
(while (setq p1 (getpoint "\nimmetti punto initial "));; first starting point
(setq p2 (getpoint p1 "\nimmetti point label "));; second label
(command "_color" 3)
(command "_line" p1 p2 "")(vla-put-color (vlax-ename->vla-object (entlast) 3)
(setvar "textsize" (atf hdesc) 0.1 sc)
(f) (car p2) (car p1))
(command "_text" p2 "" 0 (strcat " txt "));;; writes to the left
(command "_text" "ms" p2" 0 (strcat " txt "));; writes to the right
)
);
)
(alert "comanado cancelled");; just comment on this line to avoid the message
)
(snapmode)
(setvar "orthomode" ort)
(princ)
Box
inputbox: dialogue {
label="description brackets";
spacer_1;
: edit_box {
label = "description";
height = 1;
is_bold = true;
key = "text";
edit_width =40;
edit_limit = 256;
allow_accept = true;
?
: edit_box {
label = "h text";
is_bold = true;
key = "htesto";
edit_width =40;
edit_limit = 256;
allow_accept = true;
?
spacer_1;
ok_cancel;
?
I thank you in advance how many people will want to examine the problem.
Thank you.
Hello everyone
utility lies in the fact that the label is editable in a dialog box and is therefore always available in memory, without having to type it every time.
very comfortable for repeat labels.
for this lisp I have to thank the forum because it has indicated how to use the dialog box.
for 3 years it always worked.
now gives me this error:
command: ; error: the activex server returned an error: error when loading the dll library of typeswould you tell me how to solve the problem?
I think it doesn't depend on the lisp because on other computers it works.
in any way I transmit the list of the lisp and the dcl pane
program lisp
;description staff.lsp
;autocad 2014 04-10-2013
(setq snp (getvar "snapmode")
ort (getvar "orthomode")
sc (getvar "dimscale")
)
(setvar "orthomode" 0)
(setvar "snapmode" 0)
(setq dcl_id (load_dialog "inputbox.dcl"))
(if (new_dialog "inputbox" dcl_id)
;;; (vl-exit-with-error (alert "the framework of dialogue not found!"))
(exit)
)
(if (equal (type hdesc) 'real)
(setq hdesc(rtos hdesc))
)
(if (not hdesc); imposed in the dcl the value of the text height
(set_tile "htesto" (setq hdesc "2.00"))
(set_tile "htesto" hdesc)
)
(if (not txt); imposed in dcl the value of the string
(set_tile "text" (setq txt "st %%c8/20"))
(set_tile "text" txt)
)
(action_tile "text" (setq txt $value));;; recovery string value
(action_tile "htesto" (setq hdesc $value));;; recovery the value of the text height
(action_tile "accept" (done_dialog 1))
(setq answer (start_dialog))
(unload_dialog dcl_id)
(if)
(progn)
(while (setq p1 (getpoint "\nimmetti punto initial "));; first starting point
(setq p2 (getpoint p1 "\nimmetti point label "));; second label
(command "_color" 3)
(command "_line" p1 p2 "")(vla-put-color (vlax-ename->vla-object (entlast) 3)
(setvar "textsize" (atf hdesc) 0.1 sc)
(f) (car p2) (car p1))
(command "_text" p2 "" 0 (strcat " txt "));;; writes to the left
(command "_text" "ms" p2" 0 (strcat " txt "));; writes to the right
)
);
)
(alert "comanado cancelled");; just comment on this line to avoid the message
)
(snapmode)
(setvar "orthomode" ort)
(princ)
Box
inputbox: dialogue {
label="description brackets";
spacer_1;
: edit_box {
label = "description";
height = 1;
is_bold = true;
key = "text";
edit_width =40;
edit_limit = 256;
allow_accept = true;
?
: edit_box {
label = "h text";
is_bold = true;
key = "htesto";
edit_width =40;
edit_limit = 256;
allow_accept = true;
?
spacer_1;
ok_cancel;
?
I thank you in advance how many people will want to examine the problem.
Thank you.
Hello everyone