The procedure is not more comlex than what I am doing now in other places of the code.
I was not sure which layer new entities go to. But I will do as you suggest.
It will save me time avoiding repeatedly asking GiD to count the number of points in the model.
Thanks
Regards
Andrea
-----Original Message-----
From: gidlist-admin at gatxan.cimne.upc.edu [mailto:gidlist-admin at gatxan.cimne.upc.edu] On Behalf Of PUB: Ramon Ribó
Sent: giovedì 14 giugno 2007 11.18
To: gidlist at gatxan.cimne.upc.edu
Subject: Re: [GiDlist] Strange problem with MaxNumPoints
Hello,
My advice is not to go in this direction in order to create new geometry.
The promise of GiD generating always bigger numbers for the newly created points is at most approximate. It might even change in the future.
The correct way of doing is is by using auxiliary layers.
- You create a layer TMP or similar
- Make it active
- Perform your operation, like an intersection
- New points should be created in that layer
- Move the points to the appropiate layer
- Delete temporary layers
Looks complicate, but if you create a few accessory functions, it is fairly easy.
Regards,
–
Compass Ing. y Sistemas Dr. Ramon Ribo
http://www.compassis.com ramsan at compassis.com
c/ Tuset, 8 7-2 tel. +34 93 218 19 89
08006 Barcelona, Spain fax. +34 93 396 97 46
En Thu, 14 Jun 2007 15:03:59 +0200, Enrique Escolano escolano at cimne.upc.edu escribió:
Probably some new point in some algorith is not using MaxNumPoints+1
as number, and is using a lower number of a previously deleted point.
In general we use new numbers for the new entities, to provide more
control to scripts, but maybe some algorithm is reusing old free
numbers.
Maybe we need to try your specific case to find the cause of the problem.
Enrique
----- Original Message -----
From: “CALAON Andrea Dalmine R&D” acalaon at dalmine.it
To: gidlist at gatxan.cimne.upc.edu
Sent: Thursday, June 14, 2007 1:48 PM
Subject: [GiDlist] Strange problem with MaxNumPoints
Dear GiD team,
I am experiencing a strange behaviour in a Tcl procedure that
generates the intersection of lines with surfaces.
I use [GiD_Info Geometry MaxNumPoints] to know when an intersection
of a line with a surface takes place: I call the procedure twice,
before the “GiD_Process MEscape Geometry Create IntSurfLine…” and
after it, and compare the results.
If a new point has been created I change its layer and assign a
condition to it.
The code I use is this:
…
# Get the list of surfaces in special layers set
surfaces(left_roll_points) [ GiD_Geometry list surface
layer:left_roll ] set surfaces(right_roll_points) [ GiD_Geometry list
surface layer:right_roll ] set surfaces(lineal_points) "[
_GiD_Geometry list surface layer:upper_lineal ]_
[ GiD_Geometry list surface layer:lower_lineal ]"
set surfaces(int_points) [ GiD_Geometry list surface layer:plug ]
# Unassign all Dummy_point_surface conditions GiD_Process MEscape
data cond assign Dummy_point_surface delete yes escape
# Clear all points in the layer of points if they exist, otherwise
create the layers foreach layer_name [array names surfaces] {
set ipos [lsearch -exact $all_layers $layer_name]
if { $ipos == -1 } { GiD_Process Layers New $layer_name escape }
if { $ipos != -1 } { GiD_Geometry delete point layer:$layer_name
} }
set l_lines [ GiD_Geometry list line layer:auto_radial ] # First loop:
on lines
foreach line_id $l_lines {
# Use of array for shorter and easyer coding
foreach {layer_name surface_list} [array get surfaces] {
# Get the old maximum used point number before creating new
intersectons
set max_old_point_id [GiD_Info Geometry MaxNumPoints]
foreach surface_id $surface_list {
# Creating new points intersecting with the surfaces
GiD_Process MEscape Geometry Create IntSurfLine
NoDivideLines $surface_id $line_id MEscape
# Get the new maximum used point number after creating
intersectons
set max_new_point_id [GiD_Info Geometry MaxNumPoints]
if {$max_new_point_id $max_old_point_id} {
# Assign layer to the new point
GiD_Process Layers Entities $layer_name Points
$max_new_point_id MEscape
# Assign to the new point the condition
Dummy_point_surface
# with the surface the points belong to (for normals
assignment)
GiD_AssignData condition Dummy_point_surface points
[list $surface_id] $max_new_point_id
break
}
} ;# end foreach surface
} ;# end foreach layer
} ;# end first loop: on lines
…
The strange behaviour is that the procedure works fine until a
certain number of lines (I have something like thousands of lines and
tens of surfaces), ad then, even though the intersections continue to
be generated, and new points created, the MaxNumPoints seems not to
respond any more with an increased max point ID. Therefore the layer
and the condition assignments stop to be performed. What I obtain is
then the correct creation of ALL intersections, but only a partial
assignment of conditions and layers.
Is it possible that a new point is created and the MaxNumPoints does
not increase?
Is there any limit I am not considering in any of the GiD procedures
I use?
Thanks
Best regards
Andrea
GiDlist mailing list
GiDlist at gid.cimne.upc.es
_http://gid.cimne.upc.es/mailman/listinfo/gidlist_
GiDlist mailing list
GiDlist at gid.cimne.upc.es
_http://gid.cimne.upc.es/mailman/listinfo/gidlist_
\
Compass Ing. y Sistemas Dr. Ramon Ribo
http://www.compassis.com ramsan at compassis.com
c/ Tuset, 8 7-2 tel. +34 93 218 19 89
08006 Barcelona, Spain fax. +34 93 396 97 46
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist