Problem when updating the data tree

Moderator: GiD Team

Post Reply
guillermoyr
Posts: 9
Joined: Tue May 02, 2017 8:48 pm

Problem when updating the data tree

Post by guillermoyr »

Hello again! As the title reads, i have a problem with the data tree. I have a XML file where i store some input data. The user needs to select some data from a combo box, but there are some default values in there which are defined in the .spd file (e.g. cSection, bSection, bLength, etc). Once I have changed this values from the combo box, the problem type executes a proc to draw a geometry, and when I open the data tree again the values of the combo still the same (default), they haven't changed.

My question is: Where I need to put the

Code: Select all

gid_groups_conds::actualize_conditions_window
command in the .tcl file to actualize the data tree? Before or after the proc?

Here's a part of my .spd file:

Code: Select all

<container n="generalDefinitions" pn="General Definitions">
	<value n='Type' pn='Connection Type' v='1' values='[GetConnectionType]'/>
	<value n='cSection' pn='Column Section' v='HSS16X16X5/8' values='[GetColumnSectionList]'/>
	<value n='bSection' pn='Beam Section' v='W14X82' values='[GetBeamSectionList]'/>
	<value n='cHeight' pn='Column height [mm]' v='2000.00'/>
	<value n='bLength' pn='Beam length [mm]' v='1000.00'/>
</container>
Thank you so much.
--
Guillermo Yáñez
User avatar
compassis
Posts: 3
Joined: Thu Apr 09, 2015 9:29 am
Contact:

Re: Problem when updating the data tree

Post by compassis »

It is really difficult to answer your question without having more information about the structure of the data tree, and in particular the location in the .spd file of your procedure for drawing the geometry. In principle, the procedure called 'gid_groups_conds::actualize_conditions_window' should be located before the proc for drawing. In fact, perhaps it is not necessary to call the actualize_conditions window for your purposes. Unfortunatelly it would be necessary to know what you want to do in detail to be able to respond properly about the tools available for updating values in the data tree.
guillermoyr
Posts: 9
Joined: Tue May 02, 2017 8:48 pm

Re: Problem when updating the data tree

Post by guillermoyr »

Hello! Thank you compass! I have several .tcl files to create certain geometries. At the end of that code, I save the created geometry and I make a new GiD file (GiD_Process Mescape Files SaveAs... GiD_Process Mescape Files New escape). This happens each time those .tcl routines executes. Once all geometries are created, I put them together. So my data tree actualize its data from the XML source a bunch of times. It always stores the same data.

It is NECESSARY to do this (open a new file) because of my needs. I think this is the problem. Isn't it?

Regards.
compassis wrote:It is really difficult to answer your question without having more information about the structure of the data tree, and in particular the location in the .spd file of your procedure for drawing the geometry. In principle, the procedure called 'gid_groups_conds::actualize_conditions_window' should be located before the proc for drawing. In fact, perhaps it is not necessary to call the actualize_conditions window for your purposes. Unfortunatelly it would be necessary to know what you want to do in detail to be able to respond properly about the tools available for updating values in the data tree.
User avatar
compassis
Posts: 3
Joined: Thu Apr 09, 2015 9:29 am
Contact:

Re: Problem when updating the data tree

Post by compassis »

Dear Guillermo. It seems that this is the cause of the problem. The command 'GiD_Process Mescape Files New escape' calls the InitGIDProject event automatically, and therefore the procedure gid_groups_conds::begin_problemtype is called. This procedure reads the .spd file (in XML format) every time is called. I hope this helps you. Kind regards.
guillermoyr
Posts: 9
Joined: Tue May 02, 2017 8:48 pm

Re: Problem when updating the data tree

Post by guillermoyr »

Yes, I was afraid of that.... but it's good to know that. Thank you so much for your quick response.
compassis wrote:Dear Guillermo. It seems that this is the cause of the problem. The command 'GiD_Process Mescape Files New escape' calls the InitGIDProject event automatically, and therefore the procedure gid_groups_conds::begin_problemtype is called. This procedure reads the .spd file (in XML format) every time is called. I hope this helps you. Kind regards.
User avatar
escolano
Posts: 1918
Joined: Sun Sep 05, 1982 10:51 pm

Re: Problem when updating the data tree

Post by escolano »

Hi Guillermo,
Maybe, when creating a new geometry, instead of invoke a new model with
GiD_Process Mescape Files New escape
that force unload and reload also the full problemtype
you can simply invoke some procedure that delete what you have created (e.g. all volumes, all surfaces, all lines and all points?)
You can use something like this:

proc my_delete_all_geometry { } {
foreach type {volume surface line point } {
GiD_Geometry delete $type 1:end
}
}

(the screen is not updated after delete these entities, must invoke some redraw to do it if necessary)
with GiD_Redraw or GiD_Process 'Redraw

or using GiD_Process commands like
GiD_Process Mescape Geometry Delete Volumes LowerEntities 1:end escape
(LowerEntities will delete also all dependent lower entities)
...
GiD_Process Mescape Geometry Delete Surfaces 1:end escape
guillermoyr
Posts: 9
Joined: Tue May 02, 2017 8:48 pm

Re: Problem when updating the data tree

Post by guillermoyr »

I wasn't thought about this solution. It seems good!. So, this will be like I'm working on the same project all the time... You're right. I'll try and post it if this works!
escolano wrote:Hi Guillermo,
Maybe, when creating a new geometry, instead of invoke a new model with
GiD_Process Mescape Files New escape
that force unload and reload also the full problemtype
you can simply invoke some procedure that delete what you have created (e.g. all volumes, all surfaces, all lines and all points?)
You can use something like this:

proc my_delete_all_geometry { } {
foreach type {volume surface line point } {
GiD_Geometry delete $type 1:end
}
}

(the screen is not updated after delete these entities, must invoke some redraw to do it if necessary)
with GiD_Redraw or GiD_Process 'Redraw

or using GiD_Process commands like
GiD_Process Mescape Geometry Delete Volumes LowerEntities 1:end escape
(LowerEntities will delete also all dependent lower entities)
...
GiD_Process Mescape Geometry Delete Surfaces 1:end escape
Post Reply