dcl

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
any one help a didnt get value from dcl
(defun c:test (/ b p1 p2)
(vl-load-com)
(setq l 1000)
(setq dcl_id (load_dialog "samp1.dcl"))
(if (not (new_dialog "samp1" dcl_id)
);not
(exit)
);if
(set_tile "eb1" "1000")
(mode_tile "eb1" 1)
(action_tile "eb1"
"(ebox_action $value $reason)")
(defun ebox_action (val why)
(if (or (= why 2) (= why 1))
(set_tile "eb1" val)))
(action_tile
"cancel"
"(done_dialog) (setq userclick nil)"
);action_tile
(action_tile
"accept"
(strcat
"(progn
(setq d1 (get_tile \"eb1\"))"
" (done_dialog)(setq userclick T))"
)
);action tile
(start_dialog)
(unload_dialog dcl_id)
(cond ((not (tblsearch "BLOCK" "PIPE"))
(alert "\"PIPE\" block is not available in current drawing."
)
)
((tblsearch "BLOCK" "PIPE")
(setq b (vla-insertblock
(vla-get-modelspace
(vla-get-activedocument (vlax-get-acad-object))
)
(vlax-3d-point p1)
"PIPE"
1.
1.
1.
0
)
)
(LM:setdynpropvalue b "Distance1" l)
)
)
)
(princ)
)
;; Set Dynamic Block Property Value - Lee Mac
;; Modifies the value of a Dynamic Block property (if present)
;; blk - [vla] VLA Dynamic Block Reference object
;; prp - [str] Dynamic Block property name (case-insensitive)
;; val - [any] New value for property
;; Returns: [any] New value if successful, else nil
(defun LM:setdynpropvalue (blk prp val)
(setq prp (strcase prp))
(vl-some
'(lambda (x)
(if (= prp (strcase (vla-get-propertyname x)))
(progn
(vla-put-value
x
(vlax-make-variant
val
(vlax-variant-type (vla-get-value x))
)
)
(cond (val)
(t)
)
)
)
)
(vlax-invoke blk 'getdynamicblockproperties)
)
)
samp1 : dialog {
label = "PVC pipe SCH40" ;
: edit_box { //define edit box
key = "eb1" ; //give it a name
label = "Pipe Length(mm)" ; //give it a label
edit_width = 6 ;
allow_accept = true; //6 characters only
} //end edit box
ok_cancel ;
}