Harry
01-09-2004, 03:43 AM
I like to refer to some files which have a relative path and place these in a :range command.
see below.
=========================
(in-package :sample)
(use-package '(:OLI :docu))
;;(sd-defdialog 'load_sketch
;; :dialog-title "Load Sketch"
;; Place custom dir
(setf custom_dir (system::getenv "SDCORPCUSTOMIZEDIR"))
(setf filename1 (concatenate 'string custom_dir "/ANNOTA~1/Textblocks/CustomName_Sketch/file1.mi") )
(setf labelname1 "BOM EN")
(setf filename2 (concatenate 'string custom_dir "/ANNOTA~1/Textblocks/CustomName_Sketch/file2.mi") )
(setf labelname2 "BOM FR")
(setf filename3 (concatenate 'string custom_dir "/ANNOTA~1/Textblocks/CustomName_Sketch/file3.mi") )
(setf labelname3 "BOM GER")
(sd-defdialog 'load_text_block_CustomName
:dialog-title "Text Block CustomName"
:precondition
'(if (and (sd-am-inq-drawing-no) (sd-am-inq-curr-view-set))
:ok
(values :error "Please create a drawing and create/set viewset first.")
)
:variables
'(("Owner")
(type
:range ((:current-frame :label "current Frame")
(:current-sheet :label "current Sheet")
(:2dview :label "2d View")
(:sketch :label "sketch"))
:initial-value :current-sheet
:after-input (if (or (equal type :2dview) (equal type :sketch))
(progn
(sd-set-variable-status 'owner :enable t)
(setq owner nil))
(progn
(sd-set-variable-status 'owner :enable nil)
(setq owner " ")))
:size :third
)
(owner
:value-type :docupart
:initial-enable nil
:initial-value " "
:size :third
)
("Label")
(sketch
:range (( filename1 :label labelname1)
( filename2 :label labelname2)
( filename3 :label labelname3))
:initial-value filename3
)
(UI_Position
:value-type :docupntcnp
:title "Position"
:prompt-text ("Indicate Lower Right Text Block position" 1)
)
) ;; end variables
:ok-action
'(let ()
;; misc methods used to draw the sides of the box
;; load the specified sketch
(sd-am-load-sketch :file_name sketch
:position UI_Position
:adjust :lower_right
:owner_type type :owner owner)
) ;; end let
) ;; end sd-defdialog 'create-label
=========================
What is going wrong here?
I got an error in the sketch routine. The use of filename1 etc is not correct...
see below.
=========================
(in-package :sample)
(use-package '(:OLI :docu))
;;(sd-defdialog 'load_sketch
;; :dialog-title "Load Sketch"
;; Place custom dir
(setf custom_dir (system::getenv "SDCORPCUSTOMIZEDIR"))
(setf filename1 (concatenate 'string custom_dir "/ANNOTA~1/Textblocks/CustomName_Sketch/file1.mi") )
(setf labelname1 "BOM EN")
(setf filename2 (concatenate 'string custom_dir "/ANNOTA~1/Textblocks/CustomName_Sketch/file2.mi") )
(setf labelname2 "BOM FR")
(setf filename3 (concatenate 'string custom_dir "/ANNOTA~1/Textblocks/CustomName_Sketch/file3.mi") )
(setf labelname3 "BOM GER")
(sd-defdialog 'load_text_block_CustomName
:dialog-title "Text Block CustomName"
:precondition
'(if (and (sd-am-inq-drawing-no) (sd-am-inq-curr-view-set))
:ok
(values :error "Please create a drawing and create/set viewset first.")
)
:variables
'(("Owner")
(type
:range ((:current-frame :label "current Frame")
(:current-sheet :label "current Sheet")
(:2dview :label "2d View")
(:sketch :label "sketch"))
:initial-value :current-sheet
:after-input (if (or (equal type :2dview) (equal type :sketch))
(progn
(sd-set-variable-status 'owner :enable t)
(setq owner nil))
(progn
(sd-set-variable-status 'owner :enable nil)
(setq owner " ")))
:size :third
)
(owner
:value-type :docupart
:initial-enable nil
:initial-value " "
:size :third
)
("Label")
(sketch
:range (( filename1 :label labelname1)
( filename2 :label labelname2)
( filename3 :label labelname3))
:initial-value filename3
)
(UI_Position
:value-type :docupntcnp
:title "Position"
:prompt-text ("Indicate Lower Right Text Block position" 1)
)
) ;; end variables
:ok-action
'(let ()
;; misc methods used to draw the sides of the box
;; load the specified sketch
(sd-am-load-sketch :file_name sketch
:position UI_Position
:adjust :lower_right
:owner_type type :owner owner)
) ;; end let
) ;; end sd-defdialog 'create-label
=========================
What is going wrong here?
I got an error in the sketch routine. The use of filename1 etc is not correct...