From 2e6c6e2d9751901524d1c5b2f41037ab222aee3e Mon Sep 17 00:00:00 2001 From: Robert Lipman Date: Wed, 11 Sep 2024 12:41:36 -0400 Subject: [PATCH] Version 5.21 --- source/sfa-dimtol.tcl | 10 +-- source/sfa-gen.tcl | 17 +++-- source/sfa-geotol.tcl | 4 +- source/sfa-gui.tcl | 2 +- source/sfa-nist.tcl | 146 +++++++++++++++++++++++------------------- 5 files changed, 97 insertions(+), 82 deletions(-) diff --git a/source/sfa-dimtol.tcl b/source/sfa-dimtol.tcl index 6c22646..466768a 100644 --- a/source/sfa-dimtol.tcl +++ b/source/sfa-dimtol.tcl @@ -998,11 +998,9 @@ proc spmiDimtolReport {objEntity} { foreach item $badGeom { if {$okSurf} { if {[lindex $item 1] != "edge_curve"} { - errorMsg "Associated Geometry for a '[lindex $item 0]' dimension also refers to '[lindex $item 1]'. Check that this is the intended association." addCellComment $dt $r $pmiColumns(ch) "[string totitle $dimName] dimension (column E) also refers to '[lindex $item 1]'. Check that this is the intended association." } } else { - errorMsg "Associated Geometry for a '[lindex $item 0]' dimension is only a '[lindex $item 1]'. Check that this is the intended association." addCellComment $dt $r $pmiColumns(ch) "[string totitle $dimName] dimension (column E) is not associated with curved surfaces. Check that this is the intended association." } } @@ -1529,12 +1527,8 @@ proc spmiDimtolReport {objEntity} { if {$n < [expr {$lendtg-1}]} {append dtg ", "} if {$n == [expr {$lendtg-1}]} {append dtg " and "} } - if {($nistName != "nist_ftc_07" && $nistName != "nist_stc_07") || [string first ".875 ±" $dtg] == -1} { - if {[string first "Siemens NX" $cadSystem] == -1 || $developer} { - errorMsg "Multiple ([llength $dimtolGeom($dimtolGeomEnts)]) dimensions $dtg are associated with the same geometry. (IDs $dimtolGeomEnts)" - } - addCellComment $dt $r $pmiColumns(ch) "Multiple dimensions are associated with the same geometry. The identical information in this cell should appear in another Associated Geometry cell above." - } + addCellComment $dt $r $pmiColumns(ch) "Multiple dimensions are associated with the same geometry. The entities in this cell appear elsewhere in this column." + #errorMsg "Multiple ([llength $dimtolGeom($dimtolGeomEnts)]) dimensions $dtg are associated with the same geometry. (IDs $dimtolGeomEnts)" } } } diff --git a/source/sfa-gen.tcl b/source/sfa-gen.tcl index 9881993..1d38fc2 100644 --- a/source/sfa-gen.tcl +++ b/source/sfa-gen.tcl @@ -1806,23 +1806,23 @@ proc addHeaderWorksheet {numFile fname} { if {$id == 1} { append str " (Edition 1)" if {[llength $ap242ed(2)] > 0 || [llength $ap242ed(3)] > 0 || [llength $ap242ed(4)] > 0} { - errorMsg "The STEP file contains entities related to AP242 Edition 2, 3, or 4 ([join [lrmdups [concat $ap242ed(2) $ap242ed(3) $ap242ed(4)]]]),$spaces\however, the file is identified as Edition 1." red + errorMsg "The STEP file contains entities found in AP242 Edition 2, 3, or 4 ([join [lrmdups [concat $ap242ed(2) $ap242ed(3) $ap242ed(4)]]]),$spaces\however, the file is identified as Edition 1." red } } elseif {$id == 2 || $id == 3} { append str " (Edition 2)" if {$id == 2} {errorMsg " AP242 Edition 2 should be identified with '\{1 0 10303 442 3 1 4\}'" red} if {[llength $ap242ed(3)] > 0 || [llength $ap242ed(4)] > 0} { - errorMsg "The STEP file contains entities related to AP242 Edition 3 or 4 ([join [lrmdups [concat $ap242ed(3) $ap242ed(4)]]]),$spaces\however, the file is identified as Edition 2." red + errorMsg "The STEP file contains entities found in AP242 Edition 3 or 4 ([join [lrmdups [concat $ap242ed(3) $ap242ed(4)]]]),$spaces\however, the file is identified as Edition 2." red } } elseif {$id == 4} { append str " (Edition 3)" #if {[llength $ap242ed(4)] > 0} { - # errorMsg "The STEP file contains entities related to AP242 Edition 4 ([join $ap242ed(4)]),$spaces\however, the file is identified as Edition 3." red + # errorMsg "The STEP file contains entities found in AP242 Edition 4 ([join $ap242ed(4)]),$spaces\however, the file is identified as Edition 3." red #} } elseif {$id == 5} { append str " (Edition 4)" - } elseif {$id > 99} { - errorMsg "Unknown AP242 Object Identifier String '$id 1 4' for SchemaName" red + } elseif {$id > 5} { + errorMsg "Unsupported AP242 Object Identifier String '... $id 1 4' for SchemaName.\n Entities specific to this edition of AP242 are not supported in the spreadsheet but will be reported in the Syntax Checker." red } if {$developer} { foreach i {2 3 4} {if {[llength $ap242ed($i)] > 0} {regsub -all " " [join $ap242ed($i)] ", " str1; outputMsg " AP242e$i: $str1" red}} @@ -1995,7 +1995,12 @@ proc addHeaderWorksheet {numFile fname} { if {$c1 != -1} {append app2 " [string range $fos $c1+11 end]"} } elseif {[string first "Kubotek" $app2] == 0} { set c1 [string first "Kosmos Version" $fpv] - if {$c1 != -1} {append app2 " [string range $fpv $c1+15 end]"} + if {$c1 != -1} { + append app2 " [string range $fpv $c1+15 end]" + } else { + set c1 [string first "Framework Version" $fpv] + if {$c1 != -1} {append app2 " [string range $fpv $c1+18 end]"} + } } # add app2 to multiple file summary worksheet diff --git a/source/sfa-geotol.tcl b/source/sfa-geotol.tcl index ec91069..17441f8 100644 --- a/source/sfa-geotol.tcl +++ b/source/sfa-geotol.tcl @@ -717,8 +717,10 @@ proc spmiGeotolReport {objEntity} { if {[string first "datum" $ent1] == 0 && [string is alpha $pmimod]} {set pmimod "\[$pmimod\]"} append nval " $pmimod" -# reverse the order of some modifiers to match the expect PMI for FTC 8 +# reverse the order of some modifiers to match the expected PMI if {$nistName != ""} { + if {$nval == " $pmiModifiers(free_state) $pmiModifiers(common_zone)"} {set nval " $pmiModifiers(common_zone) $pmiModifiers(free_state)"} + if {$nval == " $pmiModifiers(maximum_material_requirement) $pmiModifiers(common_zone)"} {set nval " $pmiModifiers(common_zone) $pmiModifiers(maximum_material_requirement)"} if {$nval == " $pmiModifiers(free_state) $pmiModifiers(maximum_material_requirement)"} {set nval " $pmiModifiers(maximum_material_requirement) $pmiModifiers(free_state)"} if {$nval == " $pmiModifiers(tangent_plane) $pmiModifiers(free_state)"} {set nval " $pmiModifiers(free_state) $pmiModifiers(tangent_plane)"} } diff --git a/source/sfa-gui.tcl b/source/sfa-gui.tcl index f83291c..072db73 100644 --- a/source/sfa-gui.tcl +++ b/source/sfa-gui.tcl @@ -1,5 +1,5 @@ # SFA version -proc getVersion {} {return 5.20} +proc getVersion {} {return 5.21} # see proc installIFCsvr in sfa-proc.tcl for the IFCsvr version # see below (line 37) for the sfaVersion when IFCsvr was updated diff --git a/source/sfa-nist.tcl b/source/sfa-nist.tcl index 63f74ca..1353021 100644 --- a/source/sfa-nist.tcl +++ b/source/sfa-nist.tcl @@ -486,7 +486,7 @@ proc nistCheckExpectedPMI {val entstr epmiName} { # unexpected dimension association if {$pmiMatch == 0} { set pmiMatchGND [lsearch $nistPMIexpected($epmiName) $valgnd] - if {$pmiMatchGND != -1} { + if {$pmiMatchGND != -1 && [string first "\u2B69\u25CE" $val] == -1} { set pmiMatch 0.99 set pmiSimilar "Unexpected dimension association" set nistPMIexpected($epmiName) [lreplace $nistPMIexpected($epmiName) $pmiMatchGND $pmiMatchGND] @@ -559,21 +559,21 @@ proc nistCheckExpectedPMI {val entstr epmiName} { lappend nistPMIfound $pmi } +# make sure tolerance datum features are the same + } elseif {[string first "\u25BD" $val] != -1} { + set valDF [string index $val [string first "\u25BD" $val]+2] + set c2 [string first "\u25BD" $pmi] + if {$c2 != -1} { + set pmiDF [string index $pmi $c2+2] + if {$valDF == $pmiDF} {set pmiSim [stringSimilarity $val $pmi]} + } + } elseif {[string first $val $pmi] != -1 || [string first $pmi $val] != -1} { set pmiSim 0.95 } else { set tol $pmiUnicode([string range $valType($val) 0 [string last "_" $valType($val)]-1]) set pmiSim [stringSimilarity $val $pmi] -# make sure tolerance datum features are the same - if {[string index $val end] == "\]" && [string index $pmi end] == "\]"} { - if {[string index $val end-1] != [string index $pmi end-1]} { - set pmiSim [expr {$pmiSim-0.025}] - } else { - set pmiSim [expr {$pmiSim+0.025}] - } - } - if {$pmiSim < 0.9} { set sval [split $val $tol] if {[string length [lindex $sval 0]] > 0} { @@ -1181,72 +1181,73 @@ proc nistGetName {} { if {[string first "jpmi" $ftail] == 0} { if {[string first "jpmi_" $ftail] == 0} {regsub "jpmi_" $ftail "jpmi-" ftail} if {[string first "gears" $ftail] == -1 && [string first "gear" $ftail] != -1} {regsub "gear" $ftail "gears" ftail} - foreach tc {jpmi-gears jpmi-housing jpmi-knuckle jpmi-trim} {if {[string first $tc $ftail] == 0} {return $tc}} - } + foreach tc {jpmi-gears jpmi-housing jpmi-knuckle jpmi-trim} {if {[string first $tc $ftail] == 0} {set nistName $tc}} # check for a NIST CTC, FTC, STC, HTC - set testCase "" - set ok 0 - set ok1 0 - - if {[lsearch $filePrefix [string range $ftail 0 $c]] != -1 || [string first "nist" $ftail] != -1 || \ - [string first "ctc" $ftail] != -1 || [string first "ftc" $ftail] != -1 || [string first "stc" $ftail] != -1 || \ - [string first "htc" $ftail] != -1} { - if {[lsearch $filePrefix [string range $ftail 0 $c]] != -1} {set ftail [string range $ftail $c+1 end]} - - set tmp "nist_" - foreach item {ctc ftc stc htc} { - if {[string first $item $ftail] != -1} { - append tmp "$item\_" - set testCase $item + } else { + set testCase "" + set ok 0 + set ok1 0 + + if {[lsearch $filePrefix [string range $ftail 0 $c]] != -1 || [string first "nist" $ftail] != -1 || \ + [string first "ctc" $ftail] != -1 || [string first "ftc" $ftail] != -1 || [string first "stc" $ftail] != -1 || \ + [string first "htc" $ftail] != -1} { + if {[lsearch $filePrefix [string range $ftail 0 $c]] != -1} {set ftail [string range $ftail $c+1 end]} + + set tmp "nist_" + foreach item {ctc ftc stc htc} { + if {[string first $item $ftail] != -1} { + append tmp "$item\_" + set testCase $item + } } - } - if {$testCase == "htc"} {set nistName "nist_htc"} + if {$testCase == "htc"} {set nistName "nist_htc"} # find nist_ctc_01 directly - if {$testCase != ""} { - foreach zero {"0" ""} { - for {set i 1} {$i <= 11} {incr i} { - set i1 $i - if {$i < 10} {set i1 "$zero$i"} - set tmp1 "$tmp$i1" - if {[string first $tmp1 $ftail] != -1 && !$ok1} { - set nistName $tmp1 - set ok1 1 + if {$testCase != ""} { + foreach zero {"0" ""} { + for {set i 1} {$i <= 11} {incr i} { + set i1 $i + if {$i < 10} {set i1 "$zero$i"} + set tmp1 "$tmp$i1" + if {[string first $tmp1 $ftail] != -1 && !$ok1} { + set nistName $tmp1 + set ok1 1 + } } } } - } # find the number in the string - if {!$ok1 && $testCase != "htc"} { - foreach zero {"0" ""} { - for {set i 1} {$i <= 11} {incr i} { - if {!$ok} { - set i1 $i - if {$i < 10} { - set i1 "$zero$i" - set k "0$i" - } else { + if {!$ok1 && $testCase != "htc"} { + foreach zero {"0" ""} { + for {set i 1} {$i <= 11} {incr i} { + if {!$ok} { set i1 $i - set k $i - } - set c {""} - if {[string first $i1 $ftail] != [string last $i1 $ftail]} {set c {"_" "-"}} - foreach c1 $c { - for {set j 0} {$j < 2} {incr j} { - if {$j == 0} {set i2 "$c1$i1"} - if {$j == 1} {set i2 "$i1$c1"} - if {[string first $i2 $ftail] != -1 && !$ok} { - if {$testCase != ""} { - append tmp $k - } elseif {$i <= 5} { - append tmp "ctc_$k" - } else { - append tmp "ftc_$k" + if {$i < 10} { + set i1 "$zero$i" + set k "0$i" + } else { + set i1 $i + set k $i + } + set c {""} + if {[string first $i1 $ftail] != [string last $i1 $ftail]} {set c {"_" "-"}} + foreach c1 $c { + for {set j 0} {$j < 2} {incr j} { + if {$j == 0} {set i2 "$c1$i1"} + if {$j == 1} {set i2 "$i1$c1"} + if {[string first $i2 $ftail] != -1 && !$ok} { + if {$testCase != ""} { + append tmp $k + } elseif {$i <= 5} { + append tmp "ctc_$k" + } else { + append tmp "ftc_$k" + } + set nistName $tmp + set ok 1 } - set nistName $tmp - set ok 1 } } } @@ -1256,7 +1257,7 @@ proc nistGetName {} { } } -# check required rounding for ftc 6,7,8,11 +# check required rounding for some ftc, stc, and jpmi models catch {unset resetRound} catch { if {$opt(PMISEM) && $gen(Excel)} { @@ -1264,7 +1265,8 @@ proc nistGetName {} { set resetRound $opt(PMISEMRND) set opt(PMISEMRND) 0 } elseif {!$opt(PMISEMRND) && ($nistName == "nist_ftc_07" || $nistName == "nist_ftc_08" || \ - $nistName == "nist_ftc_11" || $nistName == "nist_stc_07" || $nistName == "nist_stc_08")} { + $nistName == "nist_ftc_11" || $nistName == "nist_stc_07" || $nistName == "nist_stc_08" || \ + [string first "jpmi" $nistName] == 0)} { set resetRound $opt(PMISEMRND) set opt(PMISEMRND) 1 } @@ -1337,14 +1339,26 @@ proc pmiRemoveZeros {pmi} { } # reference dimension + set deg 0 + if {[string first "$pmiUnicode(degree)\]" $spmi] != -1} { + set deg 1 + regsub $pmiUnicode(degree) $spmi "" spmi + } if {[string first "0\]" $spmi] != -1} {for {set j 0} {$j < 4} {incr j} {regsub {0\]} $spmi "\]" spmi}} if {[string first ".\]" $spmi] != -1} {regsub {.\]} $spmi "\]" spmi} if {[string first "\[0" $spmi] == 1} {regsub {\[0} $spmi "\[" spmi} + if {$deg} {regsub {\]} $spmi "$pmiUnicode(degree)\]" spmi} # basic dimension + set deg 0 + if {[string first "$pmiUnicode(degree)\)" $spmi] != -1} { + set deg 1 + regsub $pmiUnicode(degree) $spmi "" spmi + } if {[string first "0)" $spmi] != -1} {for {set j 0} {$j < 3} {incr j} {regsub {0\)} $spmi "\)" spmi}} if {[string first ".)" $spmi] != -1} {regsub {\.\)} $spmi ")" spmi} if {[string first "\(0" $spmi] == 1} {regsub {\(0} $spmi "(" spmi} + if {$deg} {regsub {\)} $spmi "$pmiUnicode(degree)\)" spmi} # radius < 1 if {[string first "R0" $spmi] != -1} {regsub "R0" $spmi "R" spmi}