PDA

View Full Version : API - IRobotFiniteElement property



luiscr
2010-03-29, 10:43 PM
I'm trying to make a small program to generate finite elements in panels.
I achieved to generate the FE. Now I want to assign each FE to a panel.
I tried do set ObjectNumber property of the FE but i get a "read-only" error.
How can I set the ObjectNumber property of a IRobotFiniteElement?

I don't want to select the FEs and generate a new panel. I want to assign the FEs to an existing panel.

Thanks in advance

marek.wiecek
2010-03-30, 07:01 AM
You can create panel and generate FEs for it or create FEs and generate panel on them.
But you can't create both panel and FEs and make them connected.

Why don't you want to get the selection of all FEs connected to your panel, add your new FE and generate panel on this new FE selection?

luiscr
2010-03-30, 09:03 AM
If I generate a new panel based in a FEs selection I get a panel with a lot of edges. The result is the creation of a edge in each FE of the border of the panel.

marek.wiecek
2010-03-31, 02:55 PM
You can freeze the panel mesh and redefine the geometry to reduce the number of edges.
The VB sample below changes the X coordinate of the beginning of 5th segment of panel contour.

Set o = R.Project.Structure.Objects.Get(1)
o.Mesh.Freeze = True
o.Update
Dim cont As RobotGeoContour
Set cont = o.Main.Geometry
Dim seg As RobotGeoSegment
Set seg = cont.Segments.Get(5)
seg.P1.Y = 0
o.Initialize
o.Update

luiscr
2010-03-31, 03:35 PM
It's not what I was expecting but it's a possible solution.
I'm going to try to make a macro to eliminate all the "exceeding" edges of a panel based in your suggestion.
Something like IF (2 consecutive edges are collinear) THEN (eliminate the point in common). If you have any VB sample that makes something near this, I would be thankful.

But it's a peaty that we can't assign FE to an existing panel.
Thanks for your help.

marek.wiecek
2010-04-01, 08:12 AM
Maybe it will be easier to generate the panel contour from scratch using only vertices (corner points) that define the panel geometry.
Do you know coordinates of these points (see bitmap attached)?
If you know all FEs you probably also know vertices of the panel.
After freezing mesh you can redefine the panel geometry using only vertices.

luiscr
2010-04-01, 10:49 AM
That's what I'm doing now. In your example it would be necessary to "eliminate" 16 vertices to get a contour with only 4 edges. In bigger panels the number of "exceeding" edges can be a lot.

But I think that in my case there can be another solution.

I have some simple applications to help the process of creating models that have panels, openings and bars. I use a Cad program where I draw the geometry and export to robot using API. I’m using this workflow because, in my case, I have much more accuracy and productivity in Cad than in RSA (only geometrical definition).

I’m getting very good results, but sometimes, in some particular points of the model, the mesh generation in RSA “is not good”. Sometimes, in a single panel, I know the geometry of the mesh that should be created to be coherent with the others panels but apparently RSA don’t. Even using different kind of mesh generation options, emitters and other kind of strategies, sometimes it takes a lot of time to solve this problem.

So I was thinking: how can I draw a mesh in Cad to export to RSA? Is it a good idea?
That’s the reason of my first post in this thread.

I have achieved to import any element (panel, bar, mesh, opening) from RSA to Cad.
I also have achieved to define a mesh in cad and export it to RSA. My problem was to assign the new generated FE to an existing panel. Now I understand that I must create a NEW panel based in the NEW generated FE. But I would like to get rid of the “unnecessary” edges.

So here is my idea.
When I create in RSA a new panel based in FE, I have in cad a shape (closed polyline) that has the edges that I want in the new panel.
I think I could redefine the geometry of the panel based in the geometry of my cad shape using API.

Thanks for your help and your time.

Luis

marek.wiecek
2010-04-01, 02:08 PM
If you can redefine the geometry of the panel based on the geometry of your cad shape, it seems to be the best solution. You will get both the mesh and the geometry exactly as you want.

luiscr
2010-04-05, 08:49 AM
I managed to load and change the contour of a panel.
How can I delete an edge and how can I add a new edge to a contour?
I tried the methods “add” and “clear” of IRobotGeoContour without success.

luiscr
2010-04-05, 09:37 PM
I tried a different approach that worked well.

Changing the property “P1” of an edge to the same value of another sequent edge makes RSA to delete one of them.

The method “add” of IRobotGeoContour worked well.
For each new edge I used this 4 lines of code:
Set seg = New RobotGeoSegmentLine
seg.P1.Set X, Y, Z
cont.Add seg ‘(”cont” is the IRobotGeoContourof the panel “PanRob”)
PanRob.Initialize

richard.parker101348332
2012-12-22, 04:43 PM
...So, I have generated the FE mesh for an area myself. But I want to know how to I create a panel from the FE elements using the API language (VB).
A sample code would be very much appreciated.
Best