set is_checkall "Y"
proc validatestylesFileName { stylesfile } {
set stylefileName [$stylesfile getCurrentValue]
if {[string match {*,*} $stylefileName] != 0 } {
GuidoMessage warning COMMA_NOT_ALLOWED_IN_FILENAME $stylefileName
return 0
} else {
return 1
}
}
proc saveStylesOpts { output_type } {
global layerTable
global save
global stylesfile
global save_styles
global is_checkall
global layer
global Purpose
global StylesCheckAll
set buffer [GuidoExecServer GetLayerFileName {}]
set layerFName [GuidoGetParamBufferValue $buffer FileName]
set buffer [ GuidoExecServer populateAllLayers {} ]
set status [GuidoGetParamBufferValue $buffer status]
set outputType [$output_type getCurrentValue]
set numberOfRows [$layerTable getRowCount]
if {$status >= 0  } {
for {set row 0} {$row < $numberOfRows} {incr row} {
if { "$outputType" == "Surpac Files" || "$outputType" == "Surpac DTM Files" } {
$StylesCheckAll setInputAllowed true
if {$is_checkall == "Y"} {
if {[$save getCurrentValue $row] == "Y"} {
set stylestatus [GuidoExecServer isStylesVerChanged [subst {sessionType = "[$layer getCurrentValue $row]"}]]
set Style [GuidoGetParamBufferValue $stylestatus VersionStatus]
set cache [GuidoExecServer GetFileFormat [subst {sessionType = "[$layer getCurrentValue $row]"}]]
set Format [GuidoGetParamBufferValue $cache FileFormat]
$Purpose setInputAllowed $row true
$stylesfile setInputAllowed $row true
set field [ GuidoGetParamBufferValue $buffer "stylesfile($row)" ]
$stylesfile setCurrentValue $row $field
$stylesfile setInputAllowed $row true
if { $Style == 1 } {
if { "[string range $Format 0 14]" == "microstationdgn" || "[string range $Format 0 6]" == "Autocad" } {
$save_styles setCurrentValue $row "Y"
$save_styles setInputAllowed $row true
$stylesfile setInputAllowed $row true
} else {
$save_styles setCurrentValue $row "N"
$save_styles setInputAllowed $row true
$stylesfile setInputAllowed $row false
}
} else {
$save_styles setCurrentValue $row "N"
$save_styles setInputAllowed $row true
$stylesfile setInputAllowed $row false
}
} else {
$stylesfile setInputAllowed $row false
$save_styles setInputAllowed $row false
$Purpose setInputAllowed $row false
}
} else {
if {[$save getCurrentValue $row] == "Y"} {
$stylesfile setInputAllowed $row true
set field [ GuidoGetParamBufferValue $buffer "stylesfile($row)" ]
$stylesfile setCurrentValue $row $field
$stylesfile setInputAllowed $row true
$save_styles setInputAllowed $row true
$Purpose setInputAllowed $row true
} else {
$stylesfile setInputAllowed $row false
$save_styles setInputAllowed $row false
$Purpose setInputAllowed $row false
}
}
} else {
$stylesfile setInputAllowed $row false
$save_styles setInputAllowed $row false
$Purpose setInputAllowed $row false
$StylesCheckAll setInputAllowed false
}
}
}
}
proc initialise { } {
global layer
global layerTable
global filename
global stylesfile
global save_styles
global Purpose
global dir
set buffer [ GuidoExecServer populateAllLayers {} ]
set status [GuidoGetParamBufferValue $buffer status]
if {$status >= 0} {
set numberOfRows [ GuidoGetParamBufferValue $buffer "LayerCount" ]
$layerTable setInitialRows $numberOfRows 1 500
set field [ GuidoGetParamBufferValue $buffer "dir" ]
$dir setCurrentValue $field
for {set row 0} {$row < $numberOfRows} {incr row} {
set field [ GuidoGetParamBufferValue $buffer "layer($row)" ]
$layer setCurrentValue $row $field
set stylestatus [GuidoExecServer isStylesVerChanged [subst {sessionType = "$field"}]]
set Style [GuidoGetParamBufferValue $stylestatus VersionStatus]
set cache [GuidoExecServer GetFileFormat [subst {sessionType = "$field"}]]
set Format [GuidoGetParamBufferValue $cache FileFormat]
set field [ GuidoGetParamBufferValue $buffer "filename($row)" ]
$filename setCurrentValue $row $field
set field [ GuidoGetParamBufferValue $buffer "Purpose($row)" ]
$Purpose setCurrentValue $row $field
set field [ GuidoGetParamBufferValue $buffer "stylesfile($row)" ]
$stylesfile setCurrentValue $row $field
if { $Style == 1  } {
if { "[string range $Format 0 14]" == "microstationdgn" || "[string range $Format 0 6]" == "Autocad" } {
$save_styles setCurrentValue $row "Y"
$save_styles setInputAllowed $row true
} else {
$save_styles setCurrentValue $row "N"
$save_styles setInputAllowed $row true
}
} else {
$save_styles setCurrentValue $row "N"
$save_styles setInputAllowed $row true
}
}
}
}
proc IscheckUncheck {save output_type} {
global layerTable
global Purpose
global save_styles
global layer
global filename
global stylesfile
set outputType [$output_type getCurrentValue]
set tick [$save getCurrentValue]
if {$tick == "Y"} {
if { "$outputType" == "Surpac Files" || "$outputType" == "Surpac DTM Files" } {
$layer setInputAllowed true
$Purpose setInputAllowed true
$filename setInputAllowed true
$Purpose setInputAllowed true
$stylesfile setInputAllowed true
$save_styles setInputAllowed true
} else {
$layer setInputAllowed true
$filename setInputAllowed true
$Purpose setInputAllowed false
$save_styles setInputAllowed false
$stylesfile setInputAllowed false
}
} else {
$layer setInputAllowed false
$filename setInputAllowed false
$Purpose setInputAllowed false
$save_styles setInputAllowed false
$stylesfile setInputAllowed false
}
}
proc checkUncheckAllStyles {StylesCheckAll} {
global layerTable
global save_styles
set tickSaveAll_ [$StylesCheckAll getCurrentValue]
set numberOfRows [$layerTable getRowCount]
for {set row 0} {$row < $numberOfRows} {incr row} {
if {$tickSaveAll_ == "Y"} {
$save_styles setCurrentValue $row "Y"
} else {
$save_styles setCurrentValue $row "N"
}
}
}
proc checkUncheckAll {checkAll output_type} {
global layerTable
global save
global Purpose
global save_styles
global is_checkall
global layer
global filename
global stylesfile
set is_checkall [$checkAll getCurrentValue]
set outputType [$output_type getCurrentValue]
set tickAll [$checkAll getCurrentValue]
set numberOfRows [$layerTable getRowCount]
for {set row 0} {$row < $numberOfRows} {incr row} {
if {$tickAll == "Y"} {
if { "$outputType" == "Surpac Files" || "$outputType" == "Surpac DTM Files" } {
$save setCurrentValue $row "Y"
$layer setInputAllowed $row true
$Purpose setInputAllowed $row true
$filename setInputAllowed $row true
$stylesfile setInputAllowed $row true
$save_styles setInputAllowed $row true
} else {
$save setCurrentValue $row "Y"
$layer setInputAllowed $row true
$Purpose setInputAllowed $row false
$filename setInputAllowed $row true
$stylesfile setInputAllowed $row false
$save_styles setInputAllowed $row false
}
} else {
$save setCurrentValue $row "N"
$layer setInputAllowed $row false
$Purpose setInputAllowed $row false
$filename setInputAllowed $row false
$stylesfile setInputAllowed $row false
$save_styles setInputAllowed $row false
}
}
}
GuidoForm CadImport {
-default_buttons
-help_id 1631
-label SAVE_ALL_LAYERS_LABEL_1
-layout BoxLayout Y_AXIS
-tip "SAVE_ALL_LAYERS_TIP_1"
GuidoPanel CadImport1 {
-border etched true
-layout CentreLineLayout
GuidoPanel CadImport1a {
-layout CentreLineLayout
GuidoComboBox output_type {
-label SAVE_ALL_OUTPUT_FORMAT_TYPE
-display_length 26
-format none
-max_length FIO_MAX_FILENAME_LENGTH
-null false
-value_in "Surpac Files" "ArcInfo Shape Files" "Autocad DXF Files" "Autocad DWG Files" "Datamine Files" "GEMS Files" "MapInfo MIF Files" "MapInfo TAB Files" "Micromine Files" "Microstation DGN Files" "Minex Files" "Vulcan Files"
-exclusive true
-default "Surpac Files"
-action valueChanged {[saveStylesOpts $output_type]}
-null false
-tip CONVERT_FILE_TYPE_TIP
}
GuidoFiller space {
-height 0.5
}
GuidoButtonGroupPanel save_option {
-label OUTPUT_DIRECTORY_OPTION
-layout CentreLineLayout
-border etched true
-tip "LAYER_SAVE_OPTION_TIP"
GuidoRadioButton  option_original {
-caption ORIGINAL_DIR
-selected_value ORIGINAL_DIR
-tip "LAYER_SAVE_OPTION_TIP1"
}
GuidoRadioButton option_specified {
-caption SPECIFIED_DIRECTORY
-selected_value SPECIFIED_DIRECTORY
-tip "LAYER_SAVE_OPTION_TIP2"
-default true
}
}
GuidoFileBrowserField dir {
-display_length 28.5
-format none
-label SAVE_ALL_LAYERS_OUTPUT_DIR
-browser_type directory
-max_length FIO_MAX_LOCATION_LENGTH
-tip OUTPUT_DIR_TIP
-translate none
-extension false
-absolutePath
-null false
-dependency {"[$option_original getCurrentValue]" == "false"}
}
}
}
GuidoTabbedPane tabPane {
GuidoPanel CadImport2 {
-label Files
-layout BoxLayout Y_AXIS
GuidoPanel CadImport2a {
-label SAVE_LAYER_INFO
-border etched true
-layout BoxLayout Y_AXIS
GuidoPanel CadImport3 {
-border etched false
-layout BorderLayout
GuidoPanel CadImport3a {
-position West
-layout BoxLayout X_AXIS
GuidoFiller fill1 {
-width 3.4
}
GuidoPanel checkAllPanel {
-layout BoxLayout X_AXIS
GuidoCheckBox checkAll {
-default true
-selected_value Y
-tip "SAVE_ALL_LAYERS_TIP_2"
-unselected_value N
-action valueChanged {[checkUncheckAll $checkAll $output_type]}
}
GuidoLabel checkAllLabel {
-height 1
-label CHECK_UNCHECK_ALL
-width 62.5
}
GuidoCheckBox StylesCheckAll {
-position East
-default true
-selected_value Y
-tip "SAVE_ALL_LAYERS_TIP_8"
-unselected_value N
-action valueChanged {[checkUncheckAllStyles $StylesCheckAll]}
}
GuidoLabel checkSaveAllStylesLabel {
-height 1
-label "CHECK_UNCHECK_ALL_2"
}
}
}
GuidoPanel CadImport3b {
-position East
-layout BoxLayout X_AXIS
GuidoPanel defaultLayerPanel {
-layout CentreLineLayout
}
GuidoFiller fill2 {
-width 1.6
}
}
}
GuidoScrollPane layerScroll {
-height 20
-border etched false
GuidoTable layerTable {
-instances 1 1 500
-interactive false
-action initial {[initialise]}
GuidoCheckBox save {
-default true
-label Save
-selected_value Y
-tip "SAVE_ALL_LAYERS_TIP_3"
-unselected_value N
-action valueChanged {[IscheckUncheck $save $output_type]}
-next_focus surpacLayer
}
GuidoLabel layer {
-display_length 20
-no_mlt
-label Layer
}
GuidoFileBrowserField filename {
-display_length 20
-format none
-label Filename
-max_length APP_MAX_LAYER_NAME_LENGTH
-tip "SAVE_ALL_LAYERS_TIP_4"
-translate none
-extension false
-null false
}
GuidoField Purpose {
-display_length 20
-format none
-label Purpose
-max_length 40
-tip "SAVE_ALL_LAYERS_TIP_5"
-translate none
}
GuidoCheckBox save_styles {
-default true
-label "Save styles"
-selected_value Y
-tip "SAVE_ALL_LAYERS_TIP_6"
-unselected_value N
-next_focus surpacLayer
}
GuidoFileBrowserField stylesfile {
-validation {[validatestylesFileName $stylesfile]}
-dependency {"[ $save_styles getCurrentValue]" == "Y"}
-display_length 16
-max_length FIO_MAX_LOCATION_LENGTH
-format none
-extension true
-translate none
-label STYLES_FILENAME
-file_mask *.ssi
-tip "SAVE_ALL_LAYERS_TIP_7"
-null false
}
}
}
}
}
GuidoPanel CadImport4 {
-label Options
-layout BoxLayout Y_AXIS
GuidoPanel pluginOptions {
-border etched true
-layout OverlayLayout
GuidoPanel AutoCAD {
-layout CentrelineLayout
-dependency {[string match "Autocad DXF Files" [$output_type getCurrentValue]] == 1 || [string match "Autocad DWG Files" [$output_type getCurrentValue]] == 1}
GuidoFiller space {
-height 0.5
}
GuidoFiller space {
-height 0.5
}
GuidoPanel AutoCAD.group {
-layout CentrelineLayout
GuidoComboBox AutoCAD.version {
-label AUTOCAD_VERSION_LABEL
-width 10
-null false
-tip "AUTOCAD_VERSION_TIP"
-value_in "Autocad 11" "Autocad 13" "Autocad 14" "Autocad 15 (2000)" "Autocad 18" "Autocad 24 (2010)"
-exclusive true
-default "Autocad 24 (2010)"
}
}
}
GuidoPanel Datamine {
-layout CentrelineLayout
-dependency {[string match "Datamine *" [$output_type getCurrentValue]] == 1}
GuidoFiller space {
-height 0.5
}
GuidoFiller space {
-height 0.5
}
GuidoPanel Datamine.group {
-layout CentrelineLayout
-border etched true
-label DATAMINE_BINARY_OUTPUT_OPTIONS
GuidoComboBox Datamine.binary_precision {
-label DATAMINE_BINARY_PRECISION_OPTION
-width 8
-null false
-tip "DATAMINE_BINARY_PRECISION_TIP"
-value_in "Single" "Double"
-exclusive true
-default "Single"
}
}
}
GuidoPanel Surpac {
-layout CentrelineLayout
-dependency {[string match "Surpac *" [$output_type getCurrentValue]] == 1}
GuidoFiller space {
-height 0.5
}
GuidoFiller space {
-height 0.5
}
GuidoPanel Surpac.group {
-layout CentrelineLayout
GuidoButtonGroupPanel Surpac.FileFormat {
-label "File format"
-layout BoxLayout Y_AXIS
-tip "SURPAC_STRING_BINARY_TIP"
GuidoRadioButton Surpac.FileFormat.text {
-caption "text"
-selected_value "text"
-default true
}
GuidoRadioButton Surpac.FileFormat.binary {
-caption "binary"
-selected_value "binary"
}
}
}
GuidoPanel Surpac.group {
-layout CentrelineLayout
-border etched true
-label "DTM/3DM Options"
GuidoCheckBox Surpac.ForceValidation {
-label "Force solid validation on save"
-default "true"
-tip "SOL_FORCE_VALIDATION"
}
GuidoCheckBox Surpac.ForceCompatibility {
-label "Force rigid backwards compatibility"
-default "true"
-tip "SOL_FORCE_COMPATIBILITY"
}
}
}
}
GuidoFiller space {
-height 0.5
}
GuidoButtonGroupPanel file_overwrite {
-label "FILE_OVERWRITE_OPTION"
-layout BoxLayout Y_AXIS
-border etched true
-tip "FILE_OVERWRITE_OPTION_TIP"
GuidoRadioButton  overwrite_all {
-caption "OVERWRITE_ALL"
-selected_value "OVERWRITE_ALL"
-default true
}
GuidoRadioButton warn_overwrite {
-caption "WARN_ON_OVERWRITE"
-selected_value "WARN_ON_OVERWRITE"
}
}
}
}
}
