[GiDlist] InitGIDProject-LoadGIDProject

Moderator: GiD Team

Christophe Louis

[GiDlist] InitGIDProject-LoadGIDProject

Post by Christophe Louis »

Hello,

I would like to know exactly when the InitGIDProject and the LoadGIDProject procedures are called. Indeed, when I call DataProblem Types..., the LoadGIDProject is also called, and when I open a saved file, the InitGIDProject is called. Is it possible to avoid calling the InitGIDProject procedure when the problem type is selected?

Christophe Louis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20020920/5e5405df/attachment.htm
Enrique Escolano

[GiDlist] InitGIDProject-LoadGIDProject

Post by Enrique Escolano »

InitGIDProject is a event generated by loading the problemtype, the argument provided is the
complete path of the directory .gid of this problem type

For example:
InitGIDProject C:/gid project/problemtypes/Test s/Vel Giro.gid

EndGIDProject is a event generated by unloading the problemtype.

LoadGIDProject is generated loading a model (also after load a problem type), the argument is the
complete path name of the file of this model to contain specific problemtype data (.spd extension)
For example:
LoadGIDProject C:/public/model.gid/model.spd

SaveGIDProject is generated if the user (or the automatic backup) save the model, it is an oportunity to the problem data to save some specific data in the spd file.

To test this events, use a WarnWinText command to show a debug message
For example, copy in 'problemtype'.tcl this code:

proc InitGIDProject { dir } {
WarnWinText "InitGIDProject $dir"
}
proc InitGIDPostProcess {} {
WarnWinText "InitGIDPostProcess"
}
proc EndGIDProject {} {
WarnWinText "EndGIDProject. Falla si había cerrado esta ventana y cargo otro problem type"
}

proc LoadGIDProject { filespd } {
WarnWinText "LoadGIDProject $filespd"
}

proc SaveGIDProject { filespd } {
WarnWinText "SaveGIDProject $filespd"
}

proc LoadResultsGIDPostProcess { file } {
WarnWinText "LoadResultsGIDPostProcess $file"
}

proc EndGIDPostProcess {} {
WarnWinText "EndGIDPostProcess"
}

proc BeforeWriteCalcFileGIDProject { file } {
WarnWinText "BeforeWriteCalcFileGIDProject $file"
}

proc AfterWriteCalcFileGIDProject { file errcode} {
WarnWinText "AfterWriteCalcFileGIDProject $file $errcode"
}

Is it not possible to avoid the call to InitGIDProject, but if you not write a proc InitGIDProject, to make some action in response, this event is ignorated.

Enrique
----- Original Message -----
From: Christophe Louis
To: Gid
Sent: Friday, September 20, 2002 12:37 PM
Subject: [GiDlist] InitGIDProject-LoadGIDProject


Hello,

I would like to know exactly when the InitGIDProject and the LoadGIDProject procedures are called. Indeed, when I call DataProblem Types..., the LoadGIDProject is also called, and when I open a saved file, the InitGIDProject is called. Is it possible to avoid calling the InitGIDProject procedure when the problem type is selected?

Christophe Louis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20020920/abffc85f/attachment.htm
Christophe Louis

[GiDlist] InitGIDProject-LoadGIDProject

Post by Christophe Louis »

In fact I would like to create a TCL/TK procedure which would be called once (and only once) when you define the problem type, and which wouldn't appear every time you open a saved project.

Christophe Louis
----- Original Message -----
From: Enrique Escolano
To: gidlist at gatxan.cimne.upc.es
Sent: Friday, September 20, 2002 2:40 PM
Subject: Re: [GiDlist] InitGIDProject-LoadGIDProject


InitGIDProject is a event generated by loading the problemtype, the argument provided is the
complete path of the directory .gid of this problem type

For example:
InitGIDProject C:/gid project/problemtypes/Test s/Vel Giro.gid

EndGIDProject is a event generated by unloading the problemtype.

LoadGIDProject is generated loading a model (also after load a problem type), the argument is the
complete path name of the file of this model to contain specific problemtype data (.spd extension)
For example:
LoadGIDProject C:/public/model.gid/model.spd

SaveGIDProject is generated if the user (or the automatic backup) save the model, it is an oportunity to the problem data to save some specific data in the spd file.

To test this events, use a WarnWinText command to show a debug message
For example, copy in 'problemtype'.tcl this code:

proc InitGIDProject { dir } {
WarnWinText "InitGIDProject $dir"
}
proc InitGIDPostProcess {} {
WarnWinText "InitGIDPostProcess"
}
proc EndGIDProject {} {
WarnWinText "EndGIDProject. Falla si había cerrado esta ventana y cargo otro problem type"
}

proc LoadGIDProject { filespd } {
WarnWinText "LoadGIDProject $filespd"
}

proc SaveGIDProject { filespd } {
WarnWinText "SaveGIDProject $filespd"
}

proc LoadResultsGIDPostProcess { file } {
WarnWinText "LoadResultsGIDPostProcess $file"
}

proc EndGIDPostProcess {} {
WarnWinText "EndGIDPostProcess"
}

proc BeforeWriteCalcFileGIDProject { file } {
WarnWinText "BeforeWriteCalcFileGIDProject $file"
}

proc AfterWriteCalcFileGIDProject { file errcode} {
WarnWinText "AfterWriteCalcFileGIDProject $file $errcode"
}

Is it not possible to avoid the call to InitGIDProject, but if you not write a proc InitGIDProject, to make some action in response, this event is ignorated.

Enrique
----- Original Message -----
From: Christophe Louis
To: Gid
Sent: Friday, September 20, 2002 12:37 PM
Subject: [GiDlist] InitGIDProject-LoadGIDProject


Hello,

I would like to know exactly when the InitGIDProject and the LoadGIDProject procedures are called. Indeed, when I call DataProblem Types..., the LoadGIDProject is also called, and when I open a saved file, the InitGIDProject is called. Is it possible to avoid calling the InitGIDProject procedure when the problem type is selected?

Christophe Louis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20020920/c602c961/attachment.htm
Ramon Ribó

[GiDlist] InitGIDProject-LoadGIDProject

Post by Ramon Ribó »

Hello,

In fact, it should be fairly easy to check, at the beginning of
InitGIDProject, if your restrictive
conditions are met.

For example, you can check that the project name is UNKNOWN by using
.central.s info Project

Regards,

--
Compass Ing. y Sistemas Dr. Ramon Ribó
http://www.compassis.com ramsan at compassis.com
c/ Manuel Girona, 61 bajos tel. +34 93 204 10 82
08034 Barcelona, Spain fax. +34 93 204 19 09

-----Mensaje original-----
De: gidlist-admin at gatxan.cimne.upc.es
[mailto:gidlist-admin at gatxan.cimne.upc.es]En nombre de Christophe Louis
Enviado el: viernes, 20 de septiembre de 2002 15:00
Para: gidlist at gatxan.cimne.upc.es
Asunto: Re: [GiDlist] InitGIDProject-LoadGIDProject


In fact I would like to create a TCL/TK procedure which would be called
once (and only once) when you define the problem type, and which wouldn't
appear every time you open a saved project.

Christophe Louis
----- Original Message -----
From: Enrique Escolano
To: gidlist at gatxan.cimne.upc.es
Sent: Friday, September 20, 2002 2:40 PM
Subject: Re: [GiDlist] InitGIDProject-LoadGIDProject


InitGIDProject is a event generated by loading the problemtype, the
argument provided is the
complete path of the directory .gid of this problem type

For example:
InitGIDProject C:/gid project/problemtypes/Test s/Vel Giro.gid

EndGIDProject is a event generated by unloading the problemtype.

LoadGIDProject is generated loading a model (also after load a problem
type), the argument is the
complete path name of the file of this model to contain specific
problemtype data (.spd extension)
For example:
LoadGIDProject C:/public/model.gid/model.spd

SaveGIDProject is generated if the user (or the automatic backup) save
the model, it is an oportunity to the problem data to save some specific
data in the spd file.

To test this events, use a WarnWinText command to show a debug message
For example, copy in 'problemtype'.tcl this code:

proc InitGIDProject { dir } {
WarnWinText "InitGIDProject $dir"
}
proc InitGIDPostProcess {} {
WarnWinText "InitGIDPostProcess"
}
proc EndGIDProject {} {
WarnWinText "EndGIDProject. Falla si había cerrado esta ventana y
cargo otro problem type"
}

proc LoadGIDProject { filespd } {
WarnWinText "LoadGIDProject $filespd"
}

proc SaveGIDProject { filespd } {
WarnWinText "SaveGIDProject $filespd"
}

proc LoadResultsGIDPostProcess { file } {
WarnWinText "LoadResultsGIDPostProcess $file"
}

proc EndGIDPostProcess {} {
WarnWinText "EndGIDPostProcess"
}

proc BeforeWriteCalcFileGIDProject { file } {
WarnWinText "BeforeWriteCalcFileGIDProject $file"
}

proc AfterWriteCalcFileGIDProject { file errcode} {
WarnWinText "AfterWriteCalcFileGIDProject $file $errcode"
}

Is it not possible to avoid the call to InitGIDProject, but if you not
write a proc InitGIDProject, to make some action in response, this event is
ignorated.

Enrique
----- Original Message -----
From: Christophe Louis
To: Gid
Sent: Friday, September 20, 2002 12:37 PM
Subject: [GiDlist] InitGIDProject-LoadGIDProject


Hello,

I would like to know exactly when the InitGIDProject and the
LoadGIDProject procedures are called. Indeed, when I call DataProblem
Types..., the LoadGIDProject is also called, and when I open a saved file,
the InitGIDProject is called. Is it possible to avoid calling the
InitGIDProject procedure when the problem type is selected?

Christophe Louis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20020923/1da8e94e/attachment.htm
Enrique Escolano

[GiDlist] InitGIDProject-LoadGIDProject

Post by Enrique Escolano »

If you read a model pertaining of a problem type, this problem type is also loaded, and the InitGIDProject event is raised

Store inside a global tcl variable a value to call your function only once.

proc InitGIDProject { dir } {
global MyProblemTypeVars
if { ![info exists MyProblemTypeVars(IsTheFisrtType)] || $MyProblemTypeVars(IsTheFisrtTime) == 0 } {
set MyProblemTypeVars(IsTheFisrtTime) 1
MyFunction
}
}

----- Original Message -----
From: Christophe Louis
To: gidlist at gatxan.cimne.upc.es
Sent: Friday, September 20, 2002 3:00 PM
Subject: Re: [GiDlist] InitGIDProject-LoadGIDProject


In fact I would like to create a TCL/TK procedure which would be called once (and only once) when you define the problem type, and which wouldn't appear every time you open a saved project.

Christophe Louis
----- Original Message -----
From: Enrique Escolano
To: gidlist at gatxan.cimne.upc.es
Sent: Friday, September 20, 2002 2:40 PM
Subject: Re: [GiDlist] InitGIDProject-LoadGIDProject


InitGIDProject is a event generated by loading the problemtype, the argument provided is the
complete path of the directory .gid of this problem type

For example:
InitGIDProject C:/gid project/problemtypes/Test s/Vel Giro.gid

EndGIDProject is a event generated by unloading the problemtype.

LoadGIDProject is generated loading a model (also after load a problem type), the argument is the
complete path name of the file of this model to contain specific problemtype data (.spd extension)
For example:
LoadGIDProject C:/public/model.gid/model.spd

SaveGIDProject is generated if the user (or the automatic backup) save the model, it is an oportunity to the problem data to save some specific data in the spd file.

To test this events, use a WarnWinText command to show a debug message
For example, copy in 'problemtype'.tcl this code:

proc InitGIDProject { dir } {
WarnWinText "InitGIDProject $dir"
}
proc InitGIDPostProcess {} {
WarnWinText "InitGIDPostProcess"
}
proc EndGIDProject {} {
WarnWinText "EndGIDProject. Falla si había cerrado esta ventana y cargo otro problem type"
}

proc LoadGIDProject { filespd } {
WarnWinText "LoadGIDProject $filespd"
}

proc SaveGIDProject { filespd } {
WarnWinText "SaveGIDProject $filespd"
}

proc LoadResultsGIDPostProcess { file } {
WarnWinText "LoadResultsGIDPostProcess $file"
}

proc EndGIDPostProcess {} {
WarnWinText "EndGIDPostProcess"
}

proc BeforeWriteCalcFileGIDProject { file } {
WarnWinText "BeforeWriteCalcFileGIDProject $file"
}

proc AfterWriteCalcFileGIDProject { file errcode} {
WarnWinText "AfterWriteCalcFileGIDProject $file $errcode"
}

Is it not possible to avoid the call to InitGIDProject, but if you not write a proc InitGIDProject, to make some action in response, this event is ignorated.

Enrique
----- Original Message -----
From: Christophe Louis
To: Gid
Sent: Friday, September 20, 2002 12:37 PM
Subject: [GiDlist] InitGIDProject-LoadGIDProject


Hello,

I would like to know exactly when the InitGIDProject and the LoadGIDProject procedures are called. Indeed, when I call DataProblem Types..., the LoadGIDProject is also called, and when I open a saved file, the InitGIDProject is called. Is it possible to avoid calling the InitGIDProject procedure when the problem type is selected?

Christophe Louis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20020925/29ac40e2/attachment.htm
VSayako Willy

[GiDlist] How to write data out for #MAT#('BookName'

Post by VSayako Willy »

Hi Enrique and all
Continue to ask about the following question:
Please advice the #MAT#('BookName')option.
When we use this option how we write the bas file out?

in my .mat file I seperated as your advice, which is
before I had more than 100 fields. I now have
Material Properties and Geometry Properties. Now
how to write the Material properties out??in bas file
by using #MAT# option. Hope you got my point.

Best regards.


__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com
Enrique Escolano

[GiDlist] How to write data out for #MAT#('BookName'

Post by Enrique Escolano »

If you use for example as a field of a material (book Geometry) a field with another material (book Material)
QUESTION:Composition_Material#MAT#(Material)
VALUE:AISI_4340_STEEL

Then, in the bas file, the name of the selected material is obtained with *MatProp
*matprop(Composition_Material)
The number of this material is obtained with *matnum(matprop(Composition_Material))
for example:

*loop materials
*set var MID=matnum(matprop(Composition_Material))
*set var PID=matnum()
Geometry material num=*PID Compition Material number=*MID
*end materials

Download the problemtype Nastran to see a god sample with #MAT# fields
(download directly from the menu Data-Problem Type-Internet Retrieve, Retrieve list)

Enrique

----- Original Message -----
From: "VSayako Willy" vilaysako at yahoo.com
To: gidlist at gatxan.cimne.upc.es
Sent: Wednesday, September 25, 2002 11:29 AM
Subject: [GiDlist] How to write data out for #MAT#('BookName') Option in .bas file


Hi Enrique and all
Continue to ask about the following question:
Please advice the #MAT#('BookName')option.
When we use this option how we write the bas file out?

in my .mat file I seperated as your advice, which is
before I had more than 100 fields. I now have
Material Properties and Geometry Properties. Now
how to write the Material properties out??in bas file
by using #MAT# option. Hope you got my point.

Best regards.


__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com
_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20020925/17391842/attachment.htm
VSayako Willy

[GiDlist] Still..How to write data out for #MAT#('BookNa

Post by VSayako Willy »

Hi Enrique
Thanks for your reply. I got your point but what I
need to write out is the fields in the material name,
for example.
in my mat file:
BOOK:Material_Properties
NUMBER:1 MATERIAL:ISO~PLASTIC
QUESTION:Young_Modulus_E
VALUE:1e4
QUESTION:Poisson_ratio
VALUE:0.3
...
END MATERIAL
NUMBER:2 MATERIAL:COMPOSITE
QUESTION:Young_Modulus_Ex
VALUE:1e6
QUESTION:Poisson_ratio_vx
VALUE:0.33
...
END MATERIAL
BOOK:Geometry_Properties
NUMBER:3 MATERIAL:Element_Thickness
QUESTION:Thickness
VALUE:0.1
QUESTION:Assigned_Material#MAT#(Material_Properties)
VALUE:ISOTROPIC
END MATERIAL
---------------------------------------
and in my data file I want to list the fields as
follows:
ISOTROPIC CASE:
Young_Modulus_E Poisson_ratio thickness
......
COMPOSITE CASE:
Young_Modulus_Ex Poisson_ratio_vx thicness
......

I tried to write out as usual way but fields in Book
Material Properties are not regconized.

Regards






--- Enrique Escolano escolano at cimne.upc.es wrote:
If you use for example as a field of a material
(book Geometry) a field with another material (book
Material)
QUESTION:Composition_Material#MAT#(Material)
VALUE:AISI_4340_STEEL

Then, in the bas file, the name of the selected
material is obtained with *MatProp
*matprop(Composition_Material)
The number of this material is obtained with
*matnum(matprop(Composition_Material))
for example:

*loop materials
*set var MID=matnum(matprop(Composition_Material))
*set var PID=matnum()
Geometry material num=*PID Compition Material
number=*MID
*end materials

Download the problemtype Nastran to see a god sample
with #MAT# fields
(download directly from the menu Data-Problem
Type-Internet Retrieve, Retrieve list)

Enrique

----- Original Message -----
From: "VSayako Willy" vilaysako at yahoo.com
To: gidlist at gatxan.cimne.upc.es
Sent: Wednesday, September 25, 2002 11:29 AM
Subject: [GiDlist] How to write data out for
#MAT#('BookName') Option in .bas file


Hi Enrique and all
Continue to ask about the following question:
Please advice the #MAT#('BookName')option.
When we use this option how we write the bas file
out?

in my .mat file I seperated as your advice, which
is
before I had more than 100 fields. I now have
Material Properties and Geometry Properties.
Now
how to write the Material properties out??in bas
file
by using #MAT# option. Hope you got my point.

Best regards.


__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com
_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist




__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com
VSayako Willy

[GiDlist] Need more your advice about mat file.

Post by VSayako Willy »

Hi Enrique and all
In case I have about 50 geomety properties in mat
file, like
NUMBER:1 MATERIAL:I_section
QUESTION:Height
VALUE:h
.....
and other different properties
END MATERIAL
NUMBER:2 MATERIAL:L_Section
QUESTION:Width
VALUE:w
.....
and other different properties fields from NUMBER:1
......
.....
END MATERIAL
NUMBER:50 MATERIAL:U_Section
.....
etc...

My question is:
1. In this case how can we write the bas file to get
the different fields of each MATERIAL when it is
assigned?
2. Can we use *if to control it? by using
NUMBER:Material numberlike 1 to 50 or
MATERIAL:Material Name?

I have tried different ways but it didn't help.

Best regards.

__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com
Enrique Escolano

[GiDlist] Need more your advice about mat file.

Post by Enrique Escolano »

It is nod valid to use as identifier the NUMBER defined in the *.mat file (in a future this word NUMBER:1 can be optional)

inside the bas file ,the material number *matnum() is different, only are considered the applied materials, renumbered to 1, 2, .. to fill holes.
Also the user can create new derived materials, with the same fields as the parent.

You must define for each material a special field (can be hidden) only to identify in the bas file the type of the material
for example:

NUMBER:1 MATERIAL:I_section
QUESTION: ID
VALUE: 1
STATE: HIDDEN
QUESTION:Height
VALUE:h
END MATERIAL
NUMBER:2 MATERIAL:L_Section
QUESTION: ID
VALUE: 2
STATE: HIDDEN
QUESTION:Width
VALUE:w
END MATERIAL


and check this identifier to use only the appropiate field names for this type of material:

*loop materials
*if(MatProp(ID,int)==1)
*MatProp(Height)
*elseif(MatProp(ID,int)==2)
*MatProp(Width)
*else
...
*endif
*end materials

It is also possible a loop over the materials not used in the model with the modifier *NotUsed

*loop materials *NotUsed
...
*end materials

Enrique

----- Original Message -----
From: "VSayako Willy" vilaysako at yahoo.com
To: gidlist at gatxan.cimne.upc.es
Sent: Thursday, September 26, 2002 9:16 AM
Subject: [GiDlist] Need more your advice about mat file.



Hi Enrique and all
In case I have about 50 geomety properties in mat
file, like
NUMBER:1 MATERIAL:I_section
QUESTION:Height
VALUE:h
.....
and other different properties
END MATERIAL
NUMBER:2 MATERIAL:L_Section
QUESTION:Width
VALUE:w
.....
and other different properties fields from NUMBER:1
......
.....
END MATERIAL
NUMBER:50 MATERIAL:U_Section
.....
etc...

My question is:
1. In this case how can we write the bas file to get
the different fields of each MATERIAL when it is
assigned?
2. Can we use *if to control it? by using
NUMBER:Material numberlike 1 to 50 or
MATERIAL:Material Name?

I have tried different ways but it didn't help.

Best regards.

__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com
_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20020926/2d9f7fd7/attachment.htm
Post Reply