Files
OpenVSP/examples/scripts/CreateEditGeom.vspscript
2017-06-16 21:34:23 -07:00

25 lines
883 B
Plaintext

void main()
{
string fid = AddGeom( "TransportFuse", "" ); // Add Fuselage
string len_id = GetParm( fid, "Length", "Design" ); // Get the Parm ID string
SetParmVal( len_id, 30.0 ); // Set the Parm Value
SetParmVal( fid, "Diameter", "Design", 4.0 );
string wid = AddGeom( "WING", "" ); // Add Wing
SetParmVal( wid, "Span", "XSec_1", 15.0 ); // Set val given geom id, parm name and group
SetParmVal( wid, "Root_Chord", "XSec_1", 10.0 );
SetParmVal( wid, "Tip_Chord", "XSec_1", 3.0 );
SetParmVal( wid, "Sweep", "XSec_1", 45.0 );
SetParmVal( wid, "X_Rel_Location", "XForm", 8.0 );
Update();
//==== Check For API Errors ====//
while ( GetNumTotalErrors() > 0 )
{
ErrorObj err = PopLastError();
Print( err.GetErrorString() );
}
}