The following functions are available for the simple Parm Link tool, which drives one Parm from another through an optional offset, scale and limits. See the Advanced Link group for links driven by a script. Click here to return to the main page.
More...
◆ DelAllParmLinks()
| void vsp::DelAllParmLinks |
( |
| ) |
|
|
extern |
Delete every simple Parm Link in the model. Advanced Links are a separate list and are left alone.
string pod1 =
AddGeom(
"POD",
"" );
string pod2 =
AddGeom(
"POD",
"" );
AddParmLink(
GetParm( pod1,
"X_Rel_Location",
"XForm" ),
GetParm( pod2,
"X_Rel_Location",
"XForm" ) );
AddParmLink(
GetParm( pod1,
"Y_Rel_Location",
"XForm" ),
GetParm( pod2,
"Y_Rel_Location",
"XForm" ) );
{
Print( "ERROR: DelAllParmLinks left links behind" );
__failure++;
}
{
Print( "ERROR: DelAllParmLinks removed an advanced link" );
__failure++;
}
std::vector< std::string > GetAdvLinkNames()
void AddAdvLink(const std::string &name)
std::string AddGeom(const std::string &type, const std::string &parent=std::string())
std::string GetParm(const std::string &geom_id, const std::string &name, const std::string &group)
- See also
- AddParmLink, DelParmLink
◆ DelParmLink()
| void vsp::DelParmLink |
( |
const std::string & | link_id | ) |
|
|
extern |
Delete a single Parm Link
string pod1 =
AddGeom(
"POD",
"" );
string pod2 =
AddGeom(
"POD",
"" );
string first = AddParmLink(
GetParm( pod1,
"X_Rel_Location",
"XForm" ),
GetParm( pod2,
"X_Rel_Location",
"XForm" ) );
string second = AddParmLink(
GetParm( pod1,
"Y_Rel_Location",
"XForm" ),
GetParm( pod2,
"Y_Rel_Location",
"XForm" ) );
{
Print( "ERROR: DelParmLink removed the wrong link" );
__failure++;
}
if ( GetNumTotalErrors() == 0 )
{
Print( "ERROR: DelParmLink accepted a bad ID" );
__failure++;
}
while ( GetNumTotalErrors() > 0 )
{
}
std::string GetParmLinkID(int index)
void DelParmLink(const std::string &link_id)
- See also
- AddParmLink, DelAllParmLinks
- Parameters
-
| [in] | link_id | string Parm Link ID |
◆ GetNumParmLinks()
| int vsp::GetNumParmLinks |
( |
| ) |
|
|
extern |
Get the number of simple Parm Links in the model
string pod1 =
AddGeom(
"POD",
"" );
string pod2 =
AddGeom(
"POD",
"" );
{
Print( "ERROR: a new model starts with Parm Links" );
__failure++;
}
AddParmLink(
GetParm( pod1,
"X_Rel_Location",
"XForm" ),
GetParm( pod2,
"X_Rel_Location",
"XForm" ) );
AddParmLink(
GetParm( pod1,
"Y_Rel_Location",
"XForm" ),
GetParm( pod2,
"Y_Rel_Location",
"XForm" ) );
{
Print( "ERROR: GetNumParmLinks did not count both links" );
__failure++;
}
{
{
Print( "ERROR: a counted link cannot be found" );
__failure++;
}
}
- See also
- AddParmLink, GetParmLinkID
- Returns
- int Number of Parm Links
◆ GetParmLinkAParm()
| std::string vsp::GetParmLinkAParm |
( |
const std::string & | link_id | ) |
|
|
extern |
Get the driving Parm of a Parm Link
string pod1 =
AddGeom(
"POD",
"" );
string pod2 =
AddGeom(
"POD",
"" );
string xa =
GetParm( pod1,
"X_Rel_Location",
"XForm" );
string xb =
GetParm( pod2,
"X_Rel_Location",
"XForm" );
string link_id = AddParmLink( xa, xb );
{
Print( "ERROR: the link does not report the Parms it was given" );
__failure++;
}
string ya =
GetParm( pod1,
"Y_Rel_Location",
"XForm" );
{
Print( "ERROR: SetParmLinkAParm did not take" );
__failure++;
}
if ( GetNumTotalErrors() == 0 )
{
Print( "ERROR: SetParmLinkAParm accepted a bad Parm ID" );
__failure++;
}
while ( GetNumTotalErrors() > 0 )
{
}
std::string GetParmLinkAParm(const std::string &link_id)
std::string GetParmLinkBParm(const std::string &link_id)
void SetParmLinkAParm(const std::string &link_id, const std::string &parm_id)
- See also
- AddParmLink, GetParmLinkBParm, SetParmLinkAParm
- Parameters
-
| [in] | link_id | string Parm Link ID |
- Returns
- string Parm ID of the driving Parm
◆ GetParmLinkBParm()
| std::string vsp::GetParmLinkBParm |
( |
const std::string & | link_id | ) |
|
|
extern |
Get the driven Parm of a Parm Link
string pod1 =
AddGeom(
"POD",
"" );
string pod2 =
AddGeom(
"POD",
"" );
string xa =
GetParm( pod1,
"X_Rel_Location",
"XForm" );
string xb =
GetParm( pod2,
"X_Rel_Location",
"XForm" );
string link_id = AddParmLink( xa, xb );
{
Print( "ERROR: GetParmLinkBParm did not report the driven Parm" );
__failure++;
}
{
Print( "ERROR: both ends of the link report the same Parm" );
__failure++;
}
- See also
- AddParmLink, GetParmLinkAParm, SetParmLinkBParm
- Parameters
-
| [in] | link_id | string Parm Link ID |
- Returns
- string Parm ID of the driven Parm
◆ GetParmLinkID()
| std::string vsp::GetParmLinkID |
( |
int | index | ) |
|
|
extern |
Get the ID of the Parm Link at the specified index
string pod1 =
AddGeom(
"POD",
"" );
string pod2 =
AddGeom(
"POD",
"" );
string first = AddParmLink(
GetParm( pod1,
"X_Rel_Location",
"XForm" ),
GetParm( pod2,
"X_Rel_Location",
"XForm" ) );
string second = AddParmLink(
GetParm( pod1,
"Y_Rel_Location",
"XForm" ),
GetParm( pod2,
"Y_Rel_Location",
"XForm" ) );
{
Print( "ERROR: GetParmLinkID did not report the links in order" );
__failure++;
}
if ( GetNumTotalErrors() == 0 )
{
Print( "ERROR: GetParmLinkID accepted an index past the end" );
__failure++;
}
while ( GetNumTotalErrors() > 0 )
{
}
- See also
- AddParmLink, GetNumParmLinks
- Parameters
-
| [in] | index | int Parm Link index |
- Returns
- string Parm Link ID
◆ GetParmLinkLowerLimitFlag()
| bool vsp::GetParmLinkLowerLimitFlag |
( |
const std::string & | link_id | ) |
|
|
extern |
Get whether a Parm Link applies its lower limit
string pod1 =
AddGeom(
"POD",
"" );
string pod2 =
AddGeom(
"POD",
"" );
string xa =
GetParm( pod1,
"X_Rel_Location",
"XForm" );
string xb =
GetParm( pod2,
"X_Rel_Location",
"XForm" );
string link_id = AddParmLink( xa, xb );
{
Print( "ERROR: the lower limit flag did not start where a new link starts" );
__failure++;
}
{
Print( "ERROR: GetParmLinkLowerLimitFlag did not follow the setter" );
__failure++;
}
bool GetParmLinkLowerLimitFlag(const std::string &link_id)
void SetParmLinkLowerLimitFlag(const std::string &link_id, bool flag)
- See also
- SetParmLinkLowerLimitFlag, AddParmLink
- Parameters
-
| [in] | link_id | string Parm Link ID |
- Returns
- bool True if the lower limit is applied
◆ GetParmLinkOffsetFlag()
| bool vsp::GetParmLinkOffsetFlag |
( |
const std::string & | link_id | ) |
|
|
extern |
Get whether a Parm Link applies its offset
string pod1 =
AddGeom(
"POD",
"" );
string pod2 =
AddGeom(
"POD",
"" );
string xa =
GetParm( pod1,
"X_Rel_Location",
"XForm" );
string xb =
GetParm( pod2,
"X_Rel_Location",
"XForm" );
string link_id = AddParmLink( xa, xb );
{
Print( "ERROR: the offset flag did not start where a new link starts" );
__failure++;
}
{
Print( "ERROR: GetParmLinkOffsetFlag did not follow the setter" );
__failure++;
}
void SetParmLinkOffsetFlag(const std::string &link_id, bool flag)
bool GetParmLinkOffsetFlag(const std::string &link_id)
- See also
- SetParmLinkOffsetFlag, AddParmLink
- Parameters
-
| [in] | link_id | string Parm Link ID |
- Returns
- bool True if the offset is applied
◆ GetParmLinkScaleFlag()
| bool vsp::GetParmLinkScaleFlag |
( |
const std::string & | link_id | ) |
|
|
extern |
Get whether a Parm Link applies its scale
string pod1 =
AddGeom(
"POD",
"" );
string pod2 =
AddGeom(
"POD",
"" );
string xa =
GetParm( pod1,
"X_Rel_Location",
"XForm" );
string xb =
GetParm( pod2,
"X_Rel_Location",
"XForm" );
string link_id = AddParmLink( xa, xb );
{
Print( "ERROR: the scale flag did not start where a new link starts" );
__failure++;
}
{
Print( "ERROR: GetParmLinkScaleFlag did not follow the setter" );
__failure++;
}
bool GetParmLinkScaleFlag(const std::string &link_id)
void SetParmLinkScaleFlag(const std::string &link_id, bool flag)
- See also
- SetParmLinkScaleFlag, AddParmLink
- Parameters
-
| [in] | link_id | string Parm Link ID |
- Returns
- bool True if the scale is applied
◆ GetParmLinkUpperLimitFlag()
| bool vsp::GetParmLinkUpperLimitFlag |
( |
const std::string & | link_id | ) |
|
|
extern |
Get whether a Parm Link applies its upper limit
string pod1 =
AddGeom(
"POD",
"" );
string pod2 =
AddGeom(
"POD",
"" );
string xa =
GetParm( pod1,
"X_Rel_Location",
"XForm" );
string xb =
GetParm( pod2,
"X_Rel_Location",
"XForm" );
string link_id = AddParmLink( xa, xb );
{
Print( "ERROR: the upper limit flag did not start where a new link starts" );
__failure++;
}
{
Print( "ERROR: GetParmLinkUpperLimitFlag did not follow the setter" );
__failure++;
}
bool GetParmLinkUpperLimitFlag(const std::string &link_id)
void SetParmLinkUpperLimitFlag(const std::string &link_id, bool flag)
- See also
- SetParmLinkUpperLimitFlag, AddParmLink
- Parameters
-
| [in] | link_id | string Parm Link ID |
- Returns
- bool True if the upper limit is applied
◆ LinkAllComp()
| bool vsp::LinkAllComp |
( |
const std::string & | parm_a_id, |
|
|
const std::string & | parm_b_id ) |
|
extern |
Link every Parm of the container holding the first Parm to the matching Parm of the container holding the second. This is the Link screen's "Link All Comp" button.
string pod1 =
AddGeom(
"POD",
"" );
string pod2 =
AddGeom(
"POD",
"" );
{
Print( "ERROR: LinkAllComp did not link the containers" );
__failure++;
}
{
{
Print( "ERROR: LinkAllComp made a link with no Parms" );
__failure++;
}
}
bool LinkAllComp(const std::string &parm_a_id, const std::string &parm_b_id)
- See also
- AddParmLink, LinkAllGroup
- Parameters
-
| [in] | parm_a_id | string Parm ID naming the driving container |
| [in] | parm_b_id | string Parm ID naming the driven container |
- Returns
- bool True if any link was made
◆ LinkAllGroup()
| bool vsp::LinkAllGroup |
( |
const std::string & | parm_a_id, |
|
|
const std::string & | parm_b_id ) |
|
extern |
Link every Parm of the group holding the first Parm to the matching Parm of the group holding the second. This is the Link screen's "Link All Group" button.
string pod1 =
AddGeom(
"POD",
"" );
string pod2 =
AddGeom(
"POD",
"" );
if ( num_group < 2 )
{
Print( "ERROR: LinkAllGroup did not link the groups" );
__failure++;
}
{
Print( "ERROR: LinkAllGroup linked more than LinkAllComp" );
__failure++;
}
bool LinkAllGroup(const std::string &parm_a_id, const std::string &parm_b_id)
- See also
- AddParmLink, LinkAllComp
- Parameters
-
| [in] | parm_a_id | string Parm ID naming the driving group |
| [in] | parm_b_id | string Parm ID naming the driven group |
- Returns
- bool True if any link was made
◆ SetParmLinkAParm()
| void vsp::SetParmLinkAParm |
( |
const std::string & | link_id, |
|
|
const std::string & | parm_id ) |
|
extern |
Set the driving Parm of a Parm Link
string pod1 =
AddGeom(
"POD",
"" );
string pod2 =
AddGeom(
"POD",
"" );
string xa =
GetParm( pod1,
"X_Rel_Location",
"XForm" );
string xb =
GetParm( pod2,
"X_Rel_Location",
"XForm" );
string link_id = AddParmLink( xa, xb );
string ya =
GetParm( pod1,
"Y_Rel_Location",
"XForm" );
{
Print( "ERROR: SetParmLinkAParm did not take" );
__failure++;
}
{
Print( "ERROR: SetParmLinkAParm disturbed the driven Parm" );
__failure++;
}
- See also
- AddParmLink, GetParmLinkAParm
- Parameters
-
| [in] | link_id | string Parm Link ID |
| [in] | parm_id | string Parm ID of the driving Parm |
◆ SetParmLinkBParm()
| void vsp::SetParmLinkBParm |
( |
const std::string & | link_id, |
|
|
const std::string & | parm_id ) |
|
extern |
Set the driven Parm of a Parm Link
string pod1 =
AddGeom(
"POD",
"" );
string pod2 =
AddGeom(
"POD",
"" );
string xa =
GetParm( pod1,
"X_Rel_Location",
"XForm" );
string xb =
GetParm( pod2,
"X_Rel_Location",
"XForm" );
string link_id = AddParmLink( xa, xb );
string yb =
GetParm( pod2,
"Y_Rel_Location",
"XForm" );
{
Print( "ERROR: SetParmLinkBParm did not take" );
__failure++;
}
{
Print( "ERROR: SetParmLinkBParm disturbed the driving Parm" );
__failure++;
}
void SetParmLinkBParm(const std::string &link_id, const std::string &parm_id)
- See also
- AddParmLink, GetParmLinkBParm
- Parameters
-
| [in] | link_id | string Parm Link ID |
| [in] | parm_id | string Parm ID of the driven Parm |
◆ SetParmLinkLowerLimitFlag()
| void vsp::SetParmLinkLowerLimitFlag |
( |
const std::string & | link_id, |
|
|
bool | flag ) |
|
extern |
Set whether a Parm Link applies its lower limit. The value itself is the link's LowerLimit Parm, reached with FindParm on the link ID.
string pod1 =
AddGeom(
"POD",
"" );
string pod2 =
AddGeom(
"POD",
"" );
string link_id = AddParmLink(
GetParm( pod1,
"X_Rel_Location",
"XForm" ),
GetParm( pod2,
"X_Rel_Location",
"XForm" ) );
{
Print( "ERROR: the lower limit flag did not take" );
__failure++;
}
{
Print( "ERROR: the lower limit flag did not clear" );
__failure++;
}
if (
FindParm( link_id,
"LowerLimit",
"Link" ).length() == 0 )
{
Print( "ERROR: the link carries no LowerLimit Parm" );
__failure++;
}
std::string FindParm(const std::string &parm_container_id, const std::string &parm_name, const std::string &group_name)
- See also
- GetParmLinkLowerLimitFlag, AddParmLink
- Parameters
-
| [in] | link_id | string Parm Link ID |
| [in] | flag | bool True to apply the lower limit |
◆ SetParmLinkOffsetFlag()
| void vsp::SetParmLinkOffsetFlag |
( |
const std::string & | link_id, |
|
|
bool | flag ) |
|
extern |
Set whether a Parm Link applies its offset. The value itself is the link's Offset Parm, reached with FindParm on the link ID.
string pod1 =
AddGeom(
"POD",
"" );
string pod2 =
AddGeom(
"POD",
"" );
string link_id = AddParmLink(
GetParm( pod1,
"X_Rel_Location",
"XForm" ),
GetParm( pod2,
"X_Rel_Location",
"XForm" ) );
{
Print( "ERROR: the offset flag did not take" );
__failure++;
}
{
Print( "ERROR: the offset flag did not clear" );
__failure++;
}
if (
FindParm( link_id,
"Offset",
"Link" ).length() == 0 )
{
Print( "ERROR: the link carries no Offset Parm" );
__failure++;
}
- See also
- GetParmLinkOffsetFlag, AddParmLink
- Parameters
-
| [in] | link_id | string Parm Link ID |
| [in] | flag | bool True to apply the offset |
◆ SetParmLinkScaleFlag()
| void vsp::SetParmLinkScaleFlag |
( |
const std::string & | link_id, |
|
|
bool | flag ) |
|
extern |
Set whether a Parm Link applies its scale. The value itself is the link's Scale Parm, reached with FindParm on the link ID.
string pod1 =
AddGeom(
"POD",
"" );
string pod2 =
AddGeom(
"POD",
"" );
string link_id = AddParmLink(
GetParm( pod1,
"X_Rel_Location",
"XForm" ),
GetParm( pod2,
"X_Rel_Location",
"XForm" ) );
{
Print( "ERROR: the scale flag did not take" );
__failure++;
}
{
Print( "ERROR: the scale flag did not clear" );
__failure++;
}
if (
FindParm( link_id,
"Scale",
"Link" ).length() == 0 )
{
Print( "ERROR: the link carries no Scale Parm" );
__failure++;
}
- See also
- GetParmLinkScaleFlag, AddParmLink
- Parameters
-
| [in] | link_id | string Parm Link ID |
| [in] | flag | bool True to apply the scale |
◆ SetParmLinkUpperLimitFlag()
| void vsp::SetParmLinkUpperLimitFlag |
( |
const std::string & | link_id, |
|
|
bool | flag ) |
|
extern |
Set whether a Parm Link applies its upper limit. The value itself is the link's UpperLimit Parm, reached with FindParm on the link ID.
string pod1 =
AddGeom(
"POD",
"" );
string pod2 =
AddGeom(
"POD",
"" );
string link_id = AddParmLink(
GetParm( pod1,
"X_Rel_Location",
"XForm" ),
GetParm( pod2,
"X_Rel_Location",
"XForm" ) );
{
Print( "ERROR: the upper limit flag did not take" );
__failure++;
}
{
Print( "ERROR: the upper limit flag did not clear" );
__failure++;
}
if (
FindParm( link_id,
"UpperLimit",
"Link" ).length() == 0 )
{
Print( "ERROR: the link carries no UpperLimit Parm" );
__failure++;
}
- See also
- GetParmLinkUpperLimitFlag, AddParmLink
- Parameters
-
| [in] | link_id | string Parm Link ID |
| [in] | flag | bool True to apply the upper limit |
◆ SortParmLinksByA()
| void vsp::SortParmLinksByA |
( |
| ) |
|
|
extern |
Sort the Parm links by the Parm each one reads from, ordering on container name, then group name, then Parm name. This is the Sort A button on the Parm Link screen.
string length =
FindParm( pod,
"Length",
"Design" );
string fine =
FindParm( pod,
"FineRatio",
"Design" );
string x_pos =
FindParm( pod,
"X_Rel_Location",
"XForm" );
string y_pos =
FindParm( pod,
"Y_Rel_Location",
"XForm" );
string link1 = AddParmLink( length, x_pos );
string link2 = AddParmLink( fine, y_pos );
{
Print( "ERROR: SortParmLinksByA did not sort the links" );
__failure++;
}
- See also
- SortParmLinksByB, AddParmLink
◆ SortParmLinksByB()
| void vsp::SortParmLinksByB |
( |
| ) |
|
|
extern |
Sort the Parm links by the Parm each one drives, ordering on container name, then group name, then Parm name. This is the Sort B button on the Parm Link screen.
string length =
FindParm( pod,
"Length",
"Design" );
string fine =
FindParm( pod,
"FineRatio",
"Design" );
string x_pos =
FindParm( pod,
"X_Rel_Location",
"XForm" );
string y_pos =
FindParm( pod,
"Y_Rel_Location",
"XForm" );
string link1 = AddParmLink( length, y_pos );
string link2 = AddParmLink( fine, x_pos );
{
Print( "ERROR: SortParmLinksByB did not sort the links" );
__failure++;
}
- See also
- SortParmLinksByA, AddParmLink