Message 1 of 11

Not applicable
11-17-2015
12:50 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, I thought I may get a better response here in the correct forum. iv got a short code that inserts a dynamic block and prompts for specific values. I'm trying to integrate it with a dialogue box, in which I have length and height in edit_boxes. I can't seem to get the values to change the variables to what is required to drive the block. The original codes I used are below, iv adapted them slightly by integrating the DCL and supporting lisp into the dynamic insert code on my computer but whatever I try I couldn't get them to work together.
All I want is a dialogue box that asks for some values then puts in the correct block and applies the parameters.
Can someone guide me in the correct direction please.
This is the DCL part iv pulled
http://www.afralisp.net/dialog-contr...ted-part-2.php
And here is the lisp I found elsewhere
(defun c:wldsym ()
(vl-load-com)
(setq osnapold (getvar "osmode"))
(setq dimsc (getvar "dimscale"))
(setq nAme (getstring "\nSymbol: "))
(setq pnt1 (getpoint "\nPoints to: "))
(setq pnt2 (getpoint pnt1 "\nSelect end of leader: "))
(setvar "cmdecho" 0)
(setvar "osmode" 0)
(command "-insert" nAme pnt1 dimsc "")
(setq b1 (vlax-ename->vla-object (entlast)))
(setq props (vlax-safearray->list (vlax-variant-value (vla-getdynamicblockproperties b1))))
(foreach prop props
(if (= (vla-get-propertyname prop) "Position1 Y")
(vla-put-value prop (cadr p2))
);if
(if (= (vla-get-propertyname prop) "Position1 X")
(vla-put-value prop (car p2))
);if
);foreach
(setvar "osmode" osanpold)
(setvar "cmdecho" 1)
(princ)
)
All I want is a dialogue box that asks for some values then puts in the correct block and applies the parameters.
Can someone guide me in the correct direction please.
This is the DCL part iv pulled
http://www.afralisp.net/dialog-contr...ted-part-2.php
And here is the lisp I found elsewhere
(defun c:wldsym ()
(vl-load-com)
(setq osnapold (getvar "osmode"))
(setq dimsc (getvar "dimscale"))
(setq nAme (getstring "\nSymbol: "))
(setq pnt1 (getpoint "\nPoints to: "))
(setq pnt2 (getpoint pnt1 "\nSelect end of leader: "))
(setvar "cmdecho" 0)
(setvar "osmode" 0)
(command "-insert" nAme pnt1 dimsc "")
(setq b1 (vlax-ename->vla-object (entlast)))
(setq props (vlax-safearray->list (vlax-variant-value (vla-getdynamicblockproperties b1))))
(foreach prop props
(if (= (vla-get-propertyname prop) "Position1 Y")
(vla-put-value prop (cadr p2))
);if
(if (= (vla-get-propertyname prop) "Position1 X")
(vla-put-value prop (car p2))
);if
);foreach
(setvar "osmode" osanpold)
(setvar "cmdecho" 1)
(princ)
)
Solved! Go to Solution.