diff --git a/source/sfa-data.tcl b/source/sfa-data.tcl index 11d0b3d..b0d4b8f 100644 --- a/source/sfa-data.tcl +++ b/source/sfa-data.tcl @@ -209,17 +209,34 @@ set badAttributes(IfcTriangulatedIrregularNetwork) {CoordIndex Normals NormalInd # in AP2.., not all but a few commonly used, all would be any entity with a name attribute, basic geometry is not included # complex entities require special exceptions in proc unicodeStrings set unicodeAttributes(advanced_brep_shape_representation) {name} +set unicodeAttributes(angular_size_and_dimensional_size_with_datum_feature) {name} +set unicodeAttributes(annotation_curve_occurrence) {name} +set unicodeAttributes(annotation_placeholder_occurrence) {name} +set unicodeAttributes(annotation_placeholder_occurrence_with_leader_line) {name} +set unicodeAttributes(annotation_plane) {name} +set unicodeAttributes(annotation_to_annotation_leader_line) {name} +set unicodeAttributes(annotation_to_model_leader_line) {name} +set unicodeAttributes(auxiliary_leader_line) {name} set unicodeAttributes(brep_with_voids) {name} +set unicodeAttributes(camera_model_d3) {name} +set unicodeAttributes(camera_model_d3_multi_clipping) {name} set unicodeAttributes(centre_of_symmetry) {name} +set unicodeAttributes(characterized_representation_and_draughting_model_and_tessellated_shape_representation) {name} set unicodeAttributes(component_path_shape_aspect) {name} set unicodeAttributes(composite_group_shape_aspect) {name} +set unicodeAttributes(composite_shape_aspect) {name} set unicodeAttributes(composite_shape_aspect_and_datum_feature) {name} set unicodeAttributes(datum_feature) {name} set unicodeAttributes(descriptive_representation_item) {name description} set unicodeAttributes(dimensional_size_with_datum_feature) {name} +set unicodeAttributes(draughting_callout) {name} +set unicodeAttributes(draughting_model) {name} +set unicodeAttributes(draughting_model_and_tessellated_shape_representation) {name} set unicodeAttributes(general_property) {name description} set unicodeAttributes(geometric_alignment) {name} +set unicodeAttributes(geometric_curve_set) {name} set unicodeAttributes(geometric_item_specific_usage) {name} +set unicodeAttributes(group) {name} set unicodeAttributes(item_identified_representation_usage) {name} set unicodeAttributes(item_defined_transformation) {name description} set unicodeAttributes(machining_tool_usage) {name} @@ -234,6 +251,7 @@ set unicodeAttributes(product_definition) {id description} set unicodeAttributes(product_definition_shape) {name description} set unicodeAttributes(product_related_product_category) {name description} set unicodeAttributes(property_definition) {name} +set unicodeAttributes(representation) {name} set unicodeAttributes(representation_context) {context_identifier context_type} set unicodeAttributes(representation_relationship) {name description} set unicodeAttributes(shape_aspect) {name} @@ -254,7 +272,7 @@ set cadApps {3D_Evolution 3DEXPERIENCE 3DTransVidia Alibre "Anark CORE" Area21 " set cadApps [sortlength2 $cadApps] # CAx-IF vendor codes (General Guidelines for the MBx Interoperability Forum) -set pairs [list {3de "3D Evolution"} {c3e "3D Experience"} {c5 "CATIA V5"} {cr "Creo"} {ct5 "3D Evolution (V5)"} {cto "3D Evolution (Creo)"} {ctx "3D Evolution (NX)"} {d5 "Datakit (V5)"} {dc "Datakit"} {di "Datakit (Inventor)"} {do "Datakit (Creo)"} {dw "Datakit (SolidWorks)"} {dx "Datakit (NX)"} {e5 "Elysium (V5)"} {ec "Elysium CadDoctor"} {eo "Elysium (Creo)"} {ex "Elysium (NX)"} {in "Autodesk Inventor"} {k3d "Kubotek (3D Framework)"} {k5 "Kubotek (V5)"} {ko "Kubotek (Creo)"} {kx "Kubotek (NX)"} {nx "Siemens NX"} {oc "Datakit (OpenCascade)"} {osv "ODA Open STEP Viewer"} {pdm "prostep ivip PDM-IF"} {sw "SolidWorks"} \ +set pairs [list {3de "3D Evolution"} {c3e "3D Experience"} {c5 "CATIA V5"} {cr "Creo"} {ct5 "3D Evolution (V5)"} {cto "3D Evolution (Creo)"} {ctx "3D Evolution (NX)"} {d3e "Datakit (3DX)"} {d5 "Datakit (V5)"} {dc "Datakit"} {di "Datakit (Inventor)"} {do "Datakit (Creo)"} {dw "Datakit (SolidWorks)"} {dx "Datakit (NX)"} {e5 "Elysium (V5)"} {ec "Elysium CadDoctor"} {eo "Elysium (Creo)"} {ex "Elysium (NX)"} {in "Autodesk Inventor"} {k3d "Kubotek (3D Framework)"} {k5 "Kubotek (V5)"} {ko "Kubotek (Creo)"} {kx "Kubotek (NX)"} {nx "Siemens NX"} {oc "Datakit (OpenCascade)"} {osv "ODA Open STEP Viewer"} {pdm "prostep ivip PDM-IF"} {sw "SolidWorks"} \ {a3 "Acrobat 3D"} {a5 "Acrobat_3D (V5)"} {ac "AutoCAD"} {al "Autodesk AliasStudio"} {au "Acrobat_3D (NX)"} {c4 "CATIA V4"} {cm "PTC CoCreate Modeling"} {fs "Vistagy FiberSim"} {h3 "HOOPS 3D Exchange"} {h5 "HOOPS 3D (V5)"} {hc "HOOPS 3D (Creo)"} {hx "HOOPS 3D (NX)"} {i5 "ITI CADfix (V5)"} {ew "Elysium (SolidWorks)"} {ic "ITI CADfix (Creo)"} {id "Siemens NX I-DEAS"} {if "ITI CADfix"} {ii "ITI CADfix (Inventor)"} {iw "ITI CADfix (SolidWorks)"} {ix "ITI CADfix (NX)"} {jn "Jotne EPM NASTRAN"} {jo "Jotne EPM openSimDM"} {kc "Kubotek KeyCreator"} {kr "Kubotek REALyze"} {kw "Kubotek (SolidWorks)"} {lk "LKSoft IDA-STEP"} {mm "Mitutoyo MiCAT Planner"} {mp "MSC Patran"} {nas "MSC NASTRAN"} {oc "Datakit (OpenCascade)"} {pc "PTC CADDS"} {pe "PTC Pro/E"} {s4 "T-Systems COM/STEP (V4)"} {s5 "T-Systems COM/FOX (V5)"} {se "Siemens SolidEdge"} {sp "Spatial ACIS"} {stp "ISO 10303 STEP"} {t3d "TechSoft3D"} {t4 "Theorem Cadverter (V4)"} {tc "Theorem Cadverter (CADDS)"} {tp "Theorem Cadverter (Pro/E)"} {tx "Theorem Cadverter (NX)"} {ug "Unigraphics"}] foreach pair $pairs {set allVendor([lindex $pair 0]) [lindex $pair 1]} diff --git a/source/sfa-gen.tcl b/source/sfa-gen.tcl index 447e5b4..b41fd63 100644 --- a/source/sfa-gen.tcl +++ b/source/sfa-gen.tcl @@ -8,7 +8,7 @@ proc genExcel {{numFile 0}} { global nistName nistPMIexpected nistPMImaster noFontFile nprogBarEnts opt pf32 p21e3Section pmiCol resetRound row rowmax savedViewButtons global savedViewName savedViewNames scriptName sheetLast skipEntities skipFileName spmiEntity spmiSumName spmiSumRow spmiTypesPerFile global startrow statsOnly stepAP stepAPreport sumHeaderRow syntaxErr tessColor tessEnts tessSolid thisEntType timeStamp tlast tolNames tolStandard tolStandards - global totalEntity unicodeActual unicodeAttributes unicodeEnts unicodeInFile unicodeNumEnts unicodeString userEntityFile userEntityList + global totalEntity unicodeActual unicodeAttributes unicodeEnts unicodeInFile unicodeNumEnts unicodeString unicodeStringCM userEntityFile userEntityList global userWriteDir useXL uuid uuidEnts valRounded viz wdir workbook workbooks worksheet worksheet1 worksheets writeDir wsCount wsNames x3dAxes global x3dColor x3dColorFile x3dColors x3dFileName x3dIndex x3dMax x3dMin x3dMsg x3dMsgColor x3dStartFile x3dViewOK xlFileName xlFileNames xlInstalled global objDesign @@ -820,6 +820,7 @@ proc genExcel {{numFile 0}} { if {$opt(PMISEM) && [string first "AP242" $stepAP] == 0 && $opt(xlFormat) != "None"} { # NIST test case + if {![info exists nistName]} {set nistName ""} if {$nistName != ""} { set tols [concat $tolNames [list dimensional_characteristic_representation datum datum_feature datum_reference_compartment datum_reference_element datum_system placed_datum_target_feature]] foreach tol $tols {if {[info exists entCount($tol)]} {set ok 1; break}} @@ -1037,6 +1038,7 @@ proc genExcel {{numFile 0}} { # check for entities in unicodeAttributes that might have Unicode strings, complex entities require special exceptions in proc unicodeStrings catch {unset unicodeString} + catch {unset unicodeStringCM} set unicodeEnts {} if {$opt(xlUnicode) && $opt(xlFormat) != "None" && $useXL} { set unicodeNumEnts 0 diff --git a/source/sfa-geotol.tcl b/source/sfa-geotol.tcl index 9b29f96..f70b659 100644 --- a/source/sfa-geotol.tcl +++ b/source/sfa-geotol.tcl @@ -2118,8 +2118,8 @@ proc spmiProjectedToleranceZone {objGuiEntity} { # composite shape aspects } elseif {[$tsa Type] == "composite_group_shape_aspect" || [$tsa Type] == "composite_shape_aspect" || \ - [$tsa Type] == "composite_shape_aspect_and_datum_feature" || [$tsa Type] == "centre_of_symmetry" || \ - [$tsa Type] == "dimensional_size_with_datum_feature"} { + [$tsa Type] == "composite_shape_aspect_and_datum_feature" || [$tsa Type] == "composite_group_shape_aspect_and_datum_feature" || \ + [$tsa Type] == "centre_of_symmetry" || [$tsa Type] == "dimensional_size_with_datum_feature"} { set e1s {} ::tcom::foreach e1 [$tsa GetUsedIn [string trim shape_aspect_relationship] [string trim relating_shape_aspect]] {lappend e1s $e1} foreach e1 $e1s { @@ -2147,13 +2147,13 @@ proc spmiProjectedToleranceZone {objGuiEntity} { } } } else { - errorMsg "For projected tolerance zone, shape_aspect '[$e2 Type]' is not supported." + errorMsg "For projected tolerance zone, shape_aspect '[formatComplexEnt [$e2 Type]]' is not supported." } } # toleranced_shape_aspect not supported } else { - errorMsg "For projected tolerance zone, toleranced_shape_aspect '[$tsa Type]' is not supported." + errorMsg "For projected tolerance zone, toleranced_shape_aspect '[formatComplexEnt [$tsa Type]]' is not supported." } # get the edge_curve that are shared between the shape aspects from (1) toleranced_shape_aspect and (2) projection_end diff --git a/source/sfa-grafpmi.tcl b/source/sfa-grafpmi.tcl index 99bcfc5..c95aa48 100644 --- a/source/sfa-grafpmi.tcl +++ b/source/sfa-grafpmi.tcl @@ -333,11 +333,11 @@ proc gpmiAnnotationReport {objEntity} { foreach e0 $objValue {if {[$e0 Type] == "apll_point_with_surface"} {set surfacePoint 1}} set msg "" if {[llength $objValue] == 1} { - set msg "Syntax Error: Leader line has only one 'point'." + set msg "Syntax Error: Leader line has only one 'point' on '[lindex $ent1 0]'." } elseif {([string first "to_model" $ent1] != -1 || [string first "auxiliary" $ent1] != -1) && $surfacePoint == 0} { - set msg "Syntax Error: Missing an 'apll_point_with_surface' for model leader line. Or use 'annotation_to_annotation_leader_line' if the line does not end on a surface." + set msg "Syntax Error: Missing an 'apll_point_with_surface' for model leader line on '[lindex $ent1 0]'. Or use 'annotation_to_annotation_leader_line' if the line does not end on a surface." } elseif {[string first "to_annotation" $ent1] != -1 && $surfacePoint == 1} { - set msg "Syntax Error: Leader line should not include 'apll_point_with_surface'. Or use 'annotation_to_model_leader_line' if the line does end on a surface." + set msg "Syntax Error: Leader line should not include 'apll_point_with_surface' on '[lindex $ent1 0]'. Or use 'annotation_to_model_leader_line' if the line does end on a surface." } if {$msg != ""} { append msg "$spaces\($recPracNames(pmi242), Sec. 7.2.4)" @@ -1458,7 +1458,7 @@ proc pmiGetCameras {} { global objDesign global cameraModels cmNameID draughtingModels draftModelCameraNames draftModelCameras dupViewpoint entCount gen mytemp opt global recPracNames savedViewFile savedViewDMName savedViewFileName savedViewItems savedViewName savedViewNames savedViewpoint - global spaces spmiTypesPerFile syntaxErr viewsWithPMI + global spaces spmiTypesPerFile syntaxErr unicodeString unicodeStringCM viewsWithPMI outputMsg " Processing viewpoints (camera_model_d3)" green catch {unset draftModelCameras} @@ -1479,6 +1479,8 @@ proc pmiGetCameras {} { regsub -all {\[} $cmname "" cmname regsub -all {\]} $cmname "" cmname set cmname [string trim $cmname] + set idx "$cm,[$e0 P21ID]" + if {[info exists unicodeStringCM($idx)]} {set cmname $unicodeStringCM($idx)} set cmNameID([$e0 P21ID]) $cmname lappend cmnames $cmname } @@ -1527,6 +1529,10 @@ proc pmiGetCameras {} { set nameDraughtingModel [$attrDraughtingModel Name] if {$nameDraughtingModel == "name" && $nattr == $iattr} { set dmname [$attrDraughtingModel Value] + if {$dmname == ""} { + set idx "$dm,name,[$entDraughtingModel P21ID]" + if {[info exists unicodeString($idx)]} {set dmname $unicodeString($idx)} + } if {$dmname == ""} { set msg "Syntax Error: For viewpoints, missing required 'name' attribute on [formatComplexEnt $dm]$spaces" append msg "($recPracNames(pmi242), Sec. 9.4.2)" diff --git a/source/sfa-grafx3d.tcl b/source/sfa-grafx3d.tcl index 9ba00a2..aee950a 100644 --- a/source/sfa-grafx3d.tcl +++ b/source/sfa-grafx3d.tcl @@ -763,7 +763,6 @@ proc x3dFileEnd {} { puts $x3dFile "\n\n$str\Part Geometry" if {[info exists nsketch]} { if {$nsketch > -1} {puts $x3dFile "\n
Sketch Geometry"} - if {$nsketch > 1000} {errorMsg " Sketch geometry ([expr {$nsketch+1}]) might take too long to view. Turn off Sketch and regenerate the View."} } if {$opt(partEdges) && $viz(EDGE)} {puts $x3dFile "\n
Edges"} } @@ -844,7 +843,10 @@ proc x3dFileEnd {} { # draughting model name not the same as the camera model name if {[info exists savedViewDMName($svn)]} { - if {$savedViewDMName($svn) != $svn && [string first "\[" $savedViewDMName($svn)] == -1 && [string first "\]" $savedViewDMName($svn)] == -1} {set svname "$savedViewDMName($svn) / $svn"} + if {$savedViewDMName($svn) != $svn && [string first "\[" $savedViewDMName($svn)] == -1 && \ + [string first "\]" $savedViewDMName($svn)] == -1 && [string first "&\#x" $svn] == -1} { + set svname "$savedViewDMName($svn) / $svn" + } } append str "$svname" puts $x3dFile $str @@ -1057,7 +1059,9 @@ proc x3dFileEnd {} { if {!$viz(PMI) || [llength $savedViewButtons] == 0} {set svb [array names savedViewpoint]} foreach svn $svb { - lappend onload "\n var view$id = document.getElementById('$svn');\n view$id.addEventListener('outputchange', function(event) \{" + set svn1 $svn + if {[string first "\;" $svn1] != -1} {regsub -all "&" $svn1 "" svn1; regsub -all "\#" $svn1 "" svn1; regsub -all "\;" $svn1 "" svn1;} + lappend onload "\n var view$id = document.getElementById('$svn1');\n view$id.addEventListener('outputchange', function(event) \{" lappend onload " document.getElementById('clickedView').innerHTML = '$svn';" incr id if {$viz(PMI)} { @@ -1207,7 +1211,9 @@ proc x3dSavedViewpoint {name} { if {$parallel} { lappend savedViewVP "" } else { - lappend savedViewVP "" + set name1 $name + if {[string first "\;" $name1] != -1} {regsub -all "&" $name1 "" name1; regsub -all "\#" $name1 "" name1; regsub -all "\;" $name1 "" name1;} + lappend savedViewVP "" } } diff --git a/source/sfa-gui.tcl b/source/sfa-gui.tcl index aac1232..6cacb21 100644 --- a/source/sfa-gui.tcl +++ b/source/sfa-gui.tcl @@ -1,5 +1,5 @@ # SFA version -proc getVersion {} {return 5.16} +proc getVersion {} {return 5.17} # see proc installIFCsvr in sfa-proc.tcl for the IFCsvr version # see below (line 37) for the sfaVersion when IFCsvr was updated @@ -79,46 +79,11 @@ proc openUserGuide {} { #------------------------------------------------------------------------------- # start window, bind keys proc guiStartWindow {} { - global fout editorCmd lastX3DOM lastXLS lastXLS1 localName localNameList wingeo winpos + global fout editorCmd lastX3DOM lastXLS lastXLS1 localName localNameList wm title . "STEP File Analyzer and Viewer [getVersion]" wm protocol . WM_DELETE_WINDOW {exit} -# check that the saved window dimensions do not exceed the screen size - if {[info exists wingeo]} { - set gwid [lindex [split $wingeo "x"] 0] - set ghgt [lindex [split $wingeo "x"] 1] - if {$gwid > [winfo screenwidth .]} {set gwid [winfo screenwidth .]} - if {$ghgt > [winfo screenheight .]} {set ghgt [winfo screenheight .]} - set wingeo "$gwid\x$ghgt" - } - -# check that the saved window position is on the screen - if {[info exists winpos]} { - set pwid [lindex [split $winpos "+"] 1] - set phgt [lindex [split $winpos "+"] 2] - if {$pwid > [winfo screenwidth .] || $pwid < -10} {set pwid 300} - if {$phgt > [winfo screenheight .] || $phgt < -10} {set phgt 200} - set winpos "+$pwid+$phgt" - } - -# check that the saved window position keeps the entire window on the screen - if {[info exists wingeo] && [info exists winpos]} { - if {[expr {$pwid+$gwid}] > [winfo screenwidth .]} { - set pwid [expr {[winfo screenwidth .]-$gwid-40}] - if {$pwid < 0} {set pwid 300} - } - if {[expr {$phgt+$ghgt}] > [winfo screenheight .]} { - set phgt [expr {[winfo screenheight .]-$ghgt-40}] - if {$phgt < 0} {set phgt 200} - } - set winpos "+$pwid+$phgt" - } - -# set the window position and dimensions - if {[info exists winpos]} {catch {wm geometry . $winpos}} - if {[info exists wingeo]} {catch {wm geometry . $wingeo}} - # yellow background color set bgcolor "#ffffbb" option add *Frame.background $bgcolor @@ -167,7 +132,7 @@ proc guiStartWindow {} { #------------------------------------------------------------------------------- # buttons and progress bar proc guiButtons {} { - global buttons ftrans mytemp nprogBarEnts nprogBarFiles opt wdir + global buttons ftrans mytemp nprogBarEnts nprogBarFiles opt wdir wingeo winpos # generate button set ftrans [frame .ftrans1 -bd 2 -background "#F0F0F0"] @@ -214,6 +179,10 @@ proc guiButtons {} { # NIST icon bitmap catch {wm iconbitmap . -default [file join $wdir images NIST.ico]} + +# set the window position and dimensions + catch {wm geometry . $winpos} + catch {wm geometry . $wingeo} } #------------------------------------------------------------------------------- @@ -963,7 +932,7 @@ proc guiMoreTab {} { tooltip::tooltip $buttons(viewCorrect) "Correct for older implementations of camera models that\nmight not conform to current recommended practices.\nThe corrected viewpoint should fix the orientation but\nmaybe not the position.\n\nSee Help > Viewer > Viewpoints\nSee the CAx-IF Recommended Practice for\n $recPracNames(pmi242), Sec. 9.4.2.6" tooltip::tooltip $buttons(viewNoPMI) "If the model has viewpoints with and without graphic PMI,\nthen also show the viewpoints without graphic PMI. Those\nviewpoints are typically top, front, side, etc." tooltip::tooltip $buttons(debugVP) "Debug viewpoint orientation defined by a camera model\nby showing the view frustum in the viewer.\n\nSee Help > Viewer > Viewpoints\nSee the CAx-IF Recommended Practice for\n $recPracNames(pmi242), Sec. 9.4.2.6" - tooltip::tooltip $buttons(partNoCap) "Use when capped surfaces for section view clipping planes\ncannot be generated or when they do not look right.\nSee Help > Viewer > New Features" + tooltip::tooltip $buttons(partNoCap) "Use when capped surfaces for section view clipping planes\ntake a long time to generate, look wrong, or if the software\ncrashes when generating them.\nSee Help > Viewer > New Features" tooltip::tooltip $buttons(brepAlt) "If curved surfaces for Part Geometry look wrong even with\nQuality set to High, use an alternative b-rep geometry\nprocessing algorithm. It will take longer to process the STEP\nfile and the resulting Viewer file will be larger." tooltip::tooltip $buttons(tessPartOld) "Process AP242 tessellated part geometry with the old method in SFA < 5.10.\nIt is not recommended for assemblies or large STEP files." tooltip::tooltip $buttons(x3dSave) "The X3D file can be shown in an X3D viewer or imported to other software.\nUse this option if an Internet connection is not available for the Viewer.\nSee Help > Viewer" @@ -1035,7 +1004,7 @@ proc guiMoreTab {} { #------------------------------------------------------------------------------- # help menu proc guiHelpMenu {} { - global ap242e3 ap242e4 bits developer Examples filesProcessed Help ifcsvrDir ifcsvrVer mytemp opt scriptName stepAPs + global bits developer Examples filesProcessed Help ifcsvrDir ifcsvrVer mytemp opt scriptName stepAPs $Help add command -label "User Guide" -command {openUserGuide} $Help add command -label "Release Notes" -command {openURL https://www.nist.gov/document/sfa-release-notes} @@ -1211,8 +1180,8 @@ manually select the clipping plane that is associated with a viewpoint or saved Capped surfaces, in the plane of the black square, are usually generated when there is only one clipping plane per section view. Switching off parts in an assembly does not turn off their capped -surfaces. If the capped surfaces look bad or if the software crashes when generating them use the -option on the More tab to disable them. +surfaces. If the capped surfaces take a long time to generate, look wrong, or if the software +crashes when generating them, then use the option on the More tab to disable them. 4 - Parallel projection viewpoints @@ -1268,6 +1237,9 @@ If there are duplicate saved view names, then a number in parentheses is appende example, two viewpoints named MBD_A will appear as MBD_A (1) and MBD_A (2) for the Viewpoint name in the upper left corner of the viewer when cycling through the viewpoints with PageDown. +Saved view names with non-English characters (Unicode) are supported in the viewer if a spreadsheet +is also generated. + On the More tab, parallel projection viewpoints as defined in the STEP file can be used instead of the default perspective. Also, if the model has viewpoints with and without graphic PMI, then the viewpoints without graphic PMI can also be shown. Those viewpoints are usually top, front, and @@ -1770,16 +1742,6 @@ See Examples > NIST CAD Models See Examples > Spreadsheets - PMI Representation" .tnb select .tnb.status } -# report new entities - if {$developer} { - $helpAnalyze add command -label "New AP242 Entities" -command { - outputMsg "\nNew AP242 Entities --------------------------------------------------------------------------------" blue - set newent [lindex [intersect3 $ap242e3 $ap242e4] 2] - outputMsg "There are [llength $newent] new entities in AP242 edition 3+\n" - foreach item $newent {outputMsg $item} - .tnb select .tnb.status - } - } $Help add separator $Help add command -label "Syntax Checker" -command { @@ -1963,6 +1925,9 @@ descriptive_representation_item worksheet and worksheets for semantic and graphi is an associated PMI validation property. Equivalent Unicode Strings are not documented in the User Guide. See Recommended Practice for PMI Unicode String Specification. +Unicode characters using \\X2\\ control directives for attribute strings on Geometry entities and +some Presentation entities are not processed. + --------------------------------------------------------------------------------------------------- Viewer - All control directives are supported for part and assembly names. Non-English characters that do not use the control directives might be shown with the wrong characters. @@ -2205,7 +2170,7 @@ See Help > Disclaimers and NIST Disclaimer" #------------------------------------------------------------------------------- # Websites menu proc guiWebsitesMenu {} { - global Websites + global ap242e3 ap242e4 developer Websites $Websites add command -label "STEP File Analyzer and Viewer" -command {openURL https://www.nist.gov/services-resources/software/step-file-analyzer-and-viewer} $Websites add command -label "STEP at NIST" -command {openURL https://www.nist.gov/ctl/smart-connected-systems-division/smart-connected-manufacturing-systems-group/step-nist} @@ -2227,6 +2192,17 @@ proc guiWebsitesMenu {} { $Websites0 add command -label "Benchmark Testing" -command {openURL http://www.asd-ssg.org/step-ap242-benchmark.html} $Websites0 add command -label "Domain Model XML" -command {openURL https://www.mbx-if.org/home/pdm/recpractices/} +# report new entities + if {$developer} { + $Websites0 add command -label "New Entities" -command { + outputMsg "\nNew AP242 Entities --------------------------------------------------------------------------------" blue + set newent [lindex [intersect3 $ap242e3 $ap242e4] 2] + outputMsg "There are [llength $newent] new entities in AP242 edition 3+\n" + foreach item $newent {outputMsg $item} + .tnb select .tnb.status + } + } + $Websites0 add separator $Websites0 add command -label "ISO 10303-242" -command {openURL https://www.iso.org/standard/84667.html} $Websites0 add command -label "STEP in 3D PDF" -command {openURL https://www.iso.org/standard/77686.html} @@ -2263,7 +2239,6 @@ proc guiWebsitesMenu {} { $Websites4 add command -label "MBx Interoperability Forum (MBx-IF)" -command {openURL https://www.mbx-if.org/home/} $Websites4 add command -label "LOTAR - LOng Term Archiving and Retrieval" -command {openURL https://lotar-international.org} $Websites4 add command -label "ISO/TC 184/SC 4 - Industrial Data" -command {openURL https://committee.iso.org/home/tc184sc4} - $Websites4 add command -label "3D PDF Formats" -command {openURL https://pdfa.org/pdf-2-0-adds-step-3d-model-support/} $Websites4 add command -label "JT-IF" -command {openURL https://www.prostep.org/en/projects/jt-project-groups-jt-wf-jt-if-jt-bm} } @@ -2821,10 +2796,6 @@ proc checkValues {} { # graphic PMI view if {$opt(viewPMI)} { lappend butNormal gpmiColor0 gpmiColor1 gpmiColor2 gpmiColor3 labelPMIcolor viewNoPMI - if {$gen(View) && ($gen(Excel) || $gen(CSV)) && $opt(xlFormat) != "None"} { - set opt(stepPRES) 1 - lappend butDisabled stepPRES - } } else { lappend butDisabled gpmiColor0 gpmiColor1 gpmiColor2 gpmiColor3 labelPMIcolor viewNoPMI } diff --git a/source/sfa-multi.tcl b/source/sfa-multi.tcl index fa1905e..34ff916 100644 --- a/source/sfa-multi.tcl +++ b/source/sfa-multi.tcl @@ -273,6 +273,7 @@ proc openMultiFile {{ask 1}} { append msg "Views" } elseif {$useXL} { append msg "Spreadsheets" + if {$gen(View)} {append msg " and Views"} } elseif {$opt(xlFormat) == "CSV"} { append msg "CSV files" } diff --git a/source/sfa-part.tcl b/source/sfa-part.tcl index e9fd8b7..579dbe9 100644 --- a/source/sfa-part.tcl +++ b/source/sfa-part.tcl @@ -42,7 +42,7 @@ proc x3dBrepGeom {} { foreach e1 [[[$e0 Attributes] Item [expr 1]] Value] { if {[$e1 Type] == "styled_item"} { set e2 [[[$e1 Attributes] Item [expr 3]] Value] - if {[$e2 Type] == "shell_based_surface_model"} {errorMsg "Surface invisibility is not supported" red} + if {[$e2 Type] == "shell_based_surface_model"} {errorMsg " Surface invisibility is not supported" red} } } } diff --git a/source/sfa-pmi.tcl b/source/sfa-pmi.tcl index 193bcdb..6e3399e 100644 --- a/source/sfa-pmi.tcl +++ b/source/sfa-pmi.tcl @@ -270,7 +270,7 @@ proc x3dTessGeom {objID tessEnt faceEnt {aoname ""}} { # ------------------------------------------------------------------------------- # TAO check for transform related to assembly proc x3dAssemblyTransform {tessEnt} { - global ao assemTransform entCount noGroupTransform syntaxErr taoLastID x3dMsg + global ao assemTransform developer entCount noGroupTransform syntaxErr taoLastID x3dMsg set debugTAO 0 set taoID [$tessEnt P21ID] @@ -380,7 +380,7 @@ proc x3dAssemblyTransform {tessEnt} { if {$nssr == 0} { set ssrRep 4 set e5s [$e4 GetUsedIn [string trim shape_representation_relationship] [string trim rep_1]] - errorMsg " Error getting ABSR in SSR rep_2, checking for ABSR in rep_1" red + if {$developer} {errorMsg " Error getting ABSR in SSR rep_2, checking for ABSR in rep_1" red} } # shape representation diff --git a/source/sfa-step.tcl b/source/sfa-step.tcl index bf133b9..7e55c41 100644 --- a/source/sfa-step.tcl +++ b/source/sfa-step.tcl @@ -412,9 +412,8 @@ proc gpmiCheckEnt {ent} { } # ------------------------------------------------------------------------------- -# which STEP entities are processed depending on options (most are already selected through Process categories) +# which STEP entities are processed depending on options proc setEntsToProcess {entType} { - global objDesign global gen gpmiEnts spmiEnts opt set ok 0 @@ -425,17 +424,10 @@ proc setEntsToProcess {entType} { if {($opt(PMIGRF) || ($gen(View) && $opt(viewPMI))) && $ok == 0} { set ok [gpmiCheckEnt $entType] set gpmiEnts($entType) $ok - if {$entType == "geometric_curve_set" || $entType == "planar_box" || [string first "geometric_set" $entType] != -1} {set ok 1} } # for PMI (semantic) representation - if {$opt(PMISEM) && $ok == 0} { - set spmiEnts($entType) [spmiCheckEnt $entType] - if {$entType == "axis2_placement_3d" && [$objDesign CountEntities "placed_datum_target_feature"] > 0} {set ok 1} - } - -# for tessellated geometry - if {$gen(View) && $opt(viewTessPart) && $ok == 0} {if {[string first "tessellated" $entType] != -1} {set ok 1}} + if {$opt(PMISEM) && $ok == 0} {set spmiEnts($entType) [spmiCheckEnt $entType]} return $ok } @@ -732,7 +724,7 @@ proc getSchemaFromFile {fname {limit 0}} { catch {unset rawBytes} set ulimit 100 - if {$limit} {set ulimit 500000} + if {$limit} {set ulimit 1000000} # read first N lines, all HEADER section information should be in the first 100 lines, reading more detects \X2\ Unicode characters while {[gets $stepfile line] != -1 && $nline < $ulimit} { @@ -849,16 +841,19 @@ proc getSchemaFromFile {fname {limit 0}} { # convert \X2\ in strings, see sfa-data.tcl for unicodeAttributes # \X\ does not have to be handled separately for a spreadsheet, complex entities need to be handled explicitly proc unicodeStrings {unicodeEnts} { - global driUnicode localName unicodeActual unicodeAttributes unicodeNumEnts unicodeString + global developer driUnicode localName stepAP unicodeActual unicodeAttributes unicodeNumEnts unicodeString unicodeStringCM if {[catch { set nent 0 set okread 1 set unicodeActual {} set sf [open $localName r] + set ap [string range $stepAP 0 4] + outputMsg "\nChecking for Unicode (non-English) characters (see More tab)" blue while {[gets $sf line] >= 0 && $okread} { - while {[string first ";" $line] == -1} {gets $sf line1; append line $line1} + while {[string first ";" $line] == -1} {gets $sf nextLine; append line $nextLine} + if {[string first "END-ISO-10303-21" $line] != -1} {set okread 0} set ok 0 set c1 [string first "=" $line] @@ -867,9 +862,27 @@ proc unicodeStrings {unicodeEnts} { foreach ent $unicodeEnts { if {$str == $ent} { set ok 1 - } elseif {[string first "COMPOSITE_SHAPE_ASPECT()DATUM_FEATURE" $line] != -1} { - set ok 1 - set ent "COMPOSITE_SHAPE_ASPECT_AND_DATUM_FEATURE" + +# special cases for AP242 complex entities + } elseif {$ap == "AP242"} { + if {[string first "COMPOSITE_SHAPE_ASPECT()DATUM_FEATURE" $line] != -1} { + set ent "COMPOSITE_SHAPE_ASPECT_AND_DATUM_FEATURE" + set ok 1 + } elseif {[string first "TESSELLATED_SHAPE_REPRESENTATION" $line] != -1} { + if {[string first "DRAUGHTING_MODEL" $line] != -1} { + if {[string first "CHARACTERIZED_REPRESENTATION" $line] != -1} { + set ent "CHARACTERIZED_REPRESENTATION_AND_DRAUGHTING_MODEL_AND_TESSELLATED_SHAPE_REPRESENTATION" + } else { + set ent "DRAUGHTING_MODEL_AND_TESSELLATED_SHAPE_REPRESENTATION" + } + } + set ok 1 + } elseif {[string first "DIMENSIONAL_SIZE_WITH_DATUM_FEATURE" $line] != -1} { + if {[string first "ANGULAR_SIZE" $line] != -1} { + set ent "ANGULAR_SIZE_AND_DIMENSIONAL_SIZE_WITH_DATUM_FEATURE" + set ok 1 + } + } } if {$ok} { set ent1 [string tolower $ent] @@ -880,18 +893,18 @@ proc unicodeStrings {unicodeEnts} { # process Unicode if {$ok} { set lattr [llength $unicodeAttributes($ent1)] - incr nent # check for Unicode X2 set oku 0 set cx2 [string first "\\X2\\" $line] if {$cx2 != -1} { set oku 1 + incr nent } elseif {[string first "equivalent" $line] != -1} { if {[string first "\\w" $line] != -1 || [string first "\\n" $line] != -1 || [string first "\\u" $line] != -1 || [string first "\\x" $line] != -1} {set oku 1} } if {$oku} { - if {$cx2 != -1} {errorMsg "\nProcessing Unicode characters (See Help > Text Strings and Numbers)" blue} + if {$cx2 != -1} {errorMsg " Processing Unicode characters (See Help > Text Strings and Numbers)" black} set id [string trim [string range $line 1 [string first "=" $line]-1]] set idx "$ent1,[lindex $unicodeAttributes($ent1) 0],$id" @@ -955,12 +968,26 @@ proc unicodeStrings {unicodeEnts} { set c1 [string first "'" $str] set c2 [string last "'" $str] if {$c1 != -1 && $c2 != -2} {set str [string range $str $c1+1 $c2-1]} - set idx "$ent1,[lindex $unicodeAttributes($ent1) $ia],$id" - if {[string index $str 0] == "="} {set str " $str"} - set unicodeString($idx) $str + set attrName [lindex $unicodeAttributes($ent1) $ia] + if {$attrName != ""} { + set idx "$ent1,[lindex $unicodeAttributes($ent1) $ia],$id" + if {[string index $str 0] == "="} {set str " $str"} + set unicodeString($idx) $str + } } } if {[lsearch $unicodeActual $ent1] == -1} {lappend unicodeActual $ent1} + +# camera model special case + if {[string first "CAMERA_MODEL" $line] != -1} { + set line2 [getUnicode $line] + set c1 [string first "'" $line2] + set c2 [string last "'" $line2] + set str [string range $line2 $c1+1 $c2-1] + set idx "$ent1,$id" + set unicodeStringCM($idx) $str + if {$developer} {errorMsg " Unicode in camera model name" red} + } } } } @@ -972,8 +999,9 @@ proc unicodeStrings {unicodeEnts} { # report entity types with Unicode if {[llength $unicodeActual] > 0} { - regsub -all " " [join [lsort $unicodeActual]] ", " str - outputMsg " [llength $unicodeActual] entity type(s): $str" + set str2 "" + foreach item [lsort $unicodeActual] {append str2 "[formatComplexEnt $item], "} + outputMsg " [llength $unicodeActual] entity type(s): [string range $str2 0 end-2]" if {[lsearch $unicodeActual "descriptive_representation_item"] != -1} {set driUnicode 1} }