|
|
4 |
| Structural Analysis Programming Course (3) |
|
|
This integrated software allows for conceptual design, structural analysis, and optimization of frame structuresMultiframeWith COM interfaces, it is possible to develop add-in programs using languages like Visual Basic and integrate them into applications such as Microsoft Office or AutoCAD. In this instance, we will introduce the development of a Delphi program utilizing Multiframe automation.
|
|
Multiframe automation sample |
|
Automation involves objectifying applications so that they can be used by different applications.
This allows other programs to control operations that would normally be performed by the user using a mouse or keyboard.
However, not all programs can be controlled by automation; it is necessary to implement automation functions within the program itself.
Please note that sample files for Multiframe automation are installed in the location specified below.
C:\Program Files\Multiframe 12\Automation Samples
- "Excel Samples" refers to sample files for use with Excel
"Word Samples" refers to sample files for use with Microsoft Word
"Access Samples" refers to sample materials for use with Access
"AutoCad Samples" refers to sample files for use with AutoCAD
|
The parent folder contains Word Samples, Access Samples, and AutoCAD Samples, so it would be a good idea to check them. First, make sure these samples are working correctly. If they don't work properly, try reinstalling the application.
First, you need to enable automation in Delphi 2010. Follow these steps to import the type library.
- In Delphi 2010, select [Component] -> [Import Component] -> [Type Library] from the menu, and then click [Next] in the dialog box that appears.
- In the search box, enter "Multiframe". Select "Multiframe1.3 ObjectLibrary" from the list that appears and click "Next".
- Specify the palette page name and the unit directory where the files will be imported. The default unit directory is "C:\DocumentsandSettings\(user folder)\MyDocuments\RADStudio\7.0\Imports\".
- Click on [Next] to proceed.
- Check the box labeled "Create Unit" and then click "Complete."
- Please ensure that the "Multiframe_TLB.pas" unit file has been output to the specified directory.
The specifications for the tools we will create here are as shown in the figure below.

Multiframe input support tool (hemispherical dome)
The number of equal divisions for the circle can be determined by user input
The number of equal divisions in the vertical direction is determined by user input |
|
Here, we specifically write programs such as the following.
• Launching Multiframe
When you import a type library, a library formatted for the Delphi language is generated.
The Multiframe application class is defined as follows:
Here, we will describe the general format of the input data file used in the sample program, as well as the Delphi classes used for reading the data.
CoApplication = class
class function Create: IApplication;
class function CreateRemote(const MachineName:
string): IApplication;
end; |
Therefore, to start Multiframe, you need to write the following code:
IMFApp := Multiframe_TLB.CoApplication.Create;
|
While the actual startup process can only be initiated with Multiframe_TLB.CoApplication.Create, a mechanism is needed to access the created object. Therefore, the address of the object is assigned to a global variable named IMFApp of type Multiframe_TLB.Application.
■ Input, coordinate setting, and element configuration processing
The parameters entered in the form are assigned to variables.
Radius := SpinEditRadius.Value;
thetaspace := SpinEditthetaspace.Value;
phispace := SpinEditphispace.Value; |
(1) Calculate the angle used for coordinate calculation
Coordinates can be calculated from the radius and angle. When viewed from above, a circle needs to be divided into equal segments (Theta space), while when viewed from the side, it needs to be divided into 90-degree segments (Psi space). The following formula can be used to calculate these:
dtheta := 2 * pi / thetaspace;
dphi := pi / 2 / phispace; |
In Delphi 2010, angles are handled in radians. The constant "pi" is defined in the System unit and represents an approximation of π (3.1415926535897932385). The increment angle can be calculated from the equation provided above.
(2) Set the coordinates
Using loops for 'i' and 'j', calculate coordinates and register nodes.
for i := 1 To phispace do
begin
phi := (i - 1) * dphi;
startnode := count + 1;
IMFApp.ScreenUpdating := False;
for j := 1 To thetaspace do
begin
count := count + 1;
theta := (j - 1) * dtheta;
x := Radius * Cos(theta) * Cos(phi);
z := Radius * Sin(theta) * Cos(phi);
y := Radius * Sin(phi);
IMFApp.frame.Nodes.AddNode(x, y, z); |
(3) Set the elements
It registers elements at the same hierarchical level. In the loop for 'j', nodes are not connected when j=1 and j=thetaspace, so `AddElement` is used to add them.
| Title := Copy( Line, 11, 40 ); |
The coordinates of the vertex are set, and elements are connected to form the top portion.
(4) Set the bottom surface to be connected by pins
Attach the bottom surface to the pin joints.
for i := 1 To thetaspace do
begin
myRest := IMFApp.frame.restraints.AddRestraint(i,
mfRestraintPinned)
end; |
■ To end Multiframe
To terminate the process, execute the following function.
|
Perform debugging and testing |
|
When you execute the program you created, you will obtain results similar to those shown in Figure 03 below.
Multiframe supports various other functions in addition to those mentioned above. These functions can be accessed from the Start button in Windows.
[Start] - [Program] - [Multiframe 12] - [Help] - [Automation Help] - [MF Automation Help]
Please note that the program described here only provides limited assistance with input. To actually perform analysis, you need to enter information such as element cross-sectional properties and weighting conditions. For details on these input methods, please refer to the Multiframe automation samples.
Announcement of paid seminars
| Introduction to Programming for Engineers Seminar CPD accredited: 6.2 points |
| • Date and time |
September 15, 2011 (Thursday), 9:30 AM to 5:00 PM |
| • Course fees |
Price for 1 person: 15,750 yen (including tax) |
| • This is the main venue |
FORUM8 Tokyo headquarters, GT Tower seminar room
※TV conferencing systemThe event will be held simultaneously in Tokyo, Osaka, Nagoya, Fukuoka, and Sendai |
|
|
| (Featured in the "Mokkasō" issue of Up&Coming '11) |
 |
|







>> Product comprehensive catalog

>> Premium membership services
>> Financial support
| Recently released products |
|
|
|