Hallo!
Nach langer erfolgloser Suche, wende ich mich nun doch an euch.
Mein Problem ist folgendes: Ich habe eine Dialogbox mit mehreren radio-buttons erstellt und eine Funktion um mehrere Layer gleichzeitig zu erstellen.
Beide funktionieren einwandfrei, nur habe ich keine Idee wie ich die beiden verknüpfe, sodass wenn ich auf der Dialogbox den Radiobutton 'Stahlbau' anklicke, die richtigen Layer erstellt werden.
Wahrscheinlich ist es eine Sache von 2-3 Zeilen, aber LISP ist für mich noch eine Fremdsprache.
Danke im vorraus!
//// Layerbox.dcl
LayerBox : dialog {
label = "Layer" ;
:boxed_radio_column {
label = "Type" ;
: radio_button {
key = "lay1" ;
label = "Straßenbau" ;
value = "1" ;
}
: radio_button {
key = "lay2" ;
label = "Stahlbau" ;
}
}
ok_cancel ;
: row {
: image {
key = "im" ;
height = 2.0 ;
width = 1.0 ;
}
: paragraph {
: text_part {
label = "Ingenieurbüro von und zu";
}
: text_part {
label = "by meiner Wenigkeit";
}
}
}
}
//////layerbox.lsp
(defun C:layerbox ()
(setq dcl_id (load_dialog "LayerBox.dcl"))
(if (not (new_dialog "LayerBox" dcl_id)
)
(exit)
)
(setq w (dimx_tile "im")
h (dimy_tile "im")
) ;setq
(start_image "im")
(fill_image 0 0 w h 5)
(end_image)
(action_tile "lay1" "(setq \"Straßenbau\")")
(action_tile "lay2" "(setq \"Stahlbau\")")
(if (= radio_option "lay_1"
(cond
((= sht_typ "0") (command "_Straßenbau"))
)
)
)
(action_tile
"cancel"
"(done_dialog) (setq userclick nil)"
) ;action_tile
(action_tile
"accept"
" (done_dialog)(setq userclick T))"
) ;action tile
(start_dialog)
(unload_dialog dcl_id)
(princ)
) ;defun C:Layerbox
(princ)
(defun _Stahlbau ( name colour linetype lineweight plot )
(if (null (tblsearch "LAYER" name))
(entmake
(list
'(0 . "LAYER")
'(100 . "AcDbSymbolTableRecord")
'(100 . "AcDbLayerTableRecord")
'(70 . 0)
(cons 2 name)
(cons 6
(if (tblsearch "LTYPE" linetype)
linetype
"Continuous"
)
)
(cons 62 colour)
(cons 290 plot)
(cons 370 lineweight )
)
)
)
)
(defun c:Stahlbau ( / )
(foreach item
'(
("Q_Lager" 5 "Continuous" -3 1)
("Q_Lager_verdeckt" 7 "verdeckt" -3 1)
("Q_Längsträger" 4 "Continuous" -3 1)
)
(apply '_Stahlbau item)
)
(princ)
)
(defun _Straßenbau ( name colour linetype lineweight plot )
(if (null (tblsearch "LAYER" name))
(entmake
(list
'(0 . "LAYER")
'(100 . "AcDbSymbolTableRecord")
'(100 . "AcDbLayerTableRecord")
'(70 . 0)
(cons 2 name)
(cons 6
(if (tblsearch "LTYPE" linetype)
linetype
"Continuous"
)
)
(cons 62 colour)
(cons 290 plot)
(cons 370 lineweight )
)
)
)
)
(defun c:Straßenbau ( / )
(foreach item
'(
("A_Boeschung" 3 "Continuous" -3 1)
("A_Boeschungsschraffur" 253 "Continuous" -3 1)
("A_Fahrbahn" 3 "Continuous" -3 1)
)
(apply '_Straßenbau item)
)
(princ)
)
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP