File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -166,6 +166,36 @@ proc ::DEM::AfterMeshGeneration { fail } {
166166 # }
167167}
168168
169+ proc ::DEM::AfterSaveModel { filespd } {
170+
171+ # GiD bug detected in versions prev to 15.0.1
172+ # Spheres disapear in groups after load. Fixing it by removing the limitation in the prj file.
173+ # GiD Team -> @jginternationa and @escolano
174+ # Fixed in any 15.1.X (developer) and 15.0.1 and later (official)
175+ if {[GidUtils::VersionCmp " 15.0.0" ] <= 0} {
176+ ::DEM::PatchMissingSpheresInGroup $filespd
177+ }
178+ }
179+
180+ proc ::DEM::PatchMissingSpheresInGroup {filespd} {
181+ set prj_file [file join [file dirname $filespd ] [file rootname $filespd ].prj]
182+ if {[file exists $prj_file ]} {
183+ dom parse [tDOM::xmlReadFile $prj_file ] doc
184+
185+ set grlist [$doc getElementsByTagName group]
186+ foreach group $grlist {
187+ if {[$group hasAttribute allowed_element_types]} {
188+ $group removeAttribute allowed_element_types
189+ }
190+ if {[$group hasAttribute allowed_types]} {
191+ $group removeAttribute allowed_types
192+ }
193+ }
194+ set fp [open $prj_file w]
195+ puts $fp [$doc asXML]
196+ close $fp
197+ }
198+ }
169199
170200
171201::DEM::Init
You can’t perform that action at this time.
0 commit comments