Alexander Heide
Guest
|
Posted:
Tue Feb 10, 2004 9:59 pm Post subject:
Transformations on Cells from Database |
|
|
Hi Group!!
I have some trouble in VBA programming and hope to find here
new ideas.
I have a database with information about the geometry of elementary
cells.
We have "Sphere", "Cylinder", "Torus", "Plane" "Cuboid" - elementary
geometrys.
"xxx" are cells in a specific Cell-Library.
My efforts are:
to place a cell corresponding to the "PosX"-, "PosY"-,
"PosZ"-Informations
in the database
to scale the cell corresponding to the "ScaleX"-, "ScaleY"-, "ScaleZ"-
Infor-
mations in the Database
to rotate the cell (Orientation in the space originally defined by
vector [0,0,1])
so that the vector [0,0,1]
- this is a imaginairy vector. Vector is used to describe the
orientation of the cell
in the space and is "bonded" on the cell. This vector is _everytimes_
[0,0,1] (!!!) -
will be transformed in vector ["OrX", "OrY", "OrZ"]. Information about
"OrX", "OrY",
"OrZ" is also from the database.
The methode to place the cell on the right position works good.
________________________________________________________________________________
Sub cell()
Dim oOrigin As Point3d
Dim oCell As CellElement
Dim cellName As String
' "Sphere"
cellName = "Sphere"
oOrigin.X = 0#
oOrigin.Y = 0#
oOrigin.Z = 0#
' Search attached cell libraries for named cell
Set oCell = CreateCellElement3(cellName, oOrigin, True)
' Display new element
oCell.Redraw msdDrawingModeNormal
' Add new element to file
ActiveModelReference.AddElement oCell
' "Cuboid"
cellName = "Cuboid"
oOrigin.X = 0#
oOrigin.Y = 0#
oOrigin.Z = 0#
' Search attached cell libraries for named cell
Set oCell = CreateCellElement3(cellName, oOrigin, True)
' Display new element
oCell.Redraw msdDrawingModeNormal
' Add new element to file
ActiveModelReference.AddElement oCell
' "Zylind"
cellName = "Zylind"
oOrigin.X = 0#
oOrigin.Y = 0#
oOrigin.Z = 0#
' Search attached cell libraries for named cell
Set oCell = CreateCellElement3(cellName, oOrigin, True)
' Display new element
oCell.Redraw msdDrawingModeNormal
' Add new element to file
ActiveModelReference.AddElement oCell
' "Torus"
cellName = "Torus"
oOrigin.X = 0#
oOrigin.Y = 0#
oOrigin.Z = 0#
' Search attached cell libraries for named cell
Set oCell = CreateCellElement3(cellName, oOrigin, True)
' Display new element
oCell.Redraw msdDrawingModeNormal
' Add new element to file
ActiveModelReference.AddElement oCell
' "Plane"
cellName = "Plane"
oOrigin.X = 0#
oOrigin.Y = 0#
oOrigin.Z = 0#
' Search attached cell libraries for named cell
Set oCell = CreateCellElement3(cellName, oOrigin,
True)
' Display new element
oCell.Redraw msdDrawingModeNormal
' Add new element to file
ActiveModelReference.AddElement oCell
End Sub
____________________________________________________________________________________
But how to let readout the informations from the database?
Sphere_______ Informations in columns
Cuboid_______ Informations in columns
....
How is it possible to scale the cell and to rotate them conform the
data sets
in the database??
Specially how to make it just after the setting the cell in Design
File.
I would like to perform (set,-> scale,-> rotate ) step by step on
every cells
in the lines of database.
IT WOULD BE GREAT TO RECEIVE SOME IMPULSES ON RIGHT DIRECTION HOW TO
PERFORM
THE DESCRIBED MANIPULATIONS.
I thank you verry much for your attention.
Greetings Alexander
|
|