-
Notifications
You must be signed in to change notification settings - Fork 5
Tutorials
[TBD]
[TBD]
[TBD]
[TBD]
[TBD]
[TBD]
[TBD]
[TBD]
[TBD]
So, you've added a module to your part, but you want it to show up in the PAM (Part Action Manager), as this does not happen by default. For this you want to add the following after the part where you add your modules
:parts ... {
// Add the modules here
PAMModuleVisualsOverride: +[
{
PartComponentModuleName: "...", // This is the module (usually of the form PartComponentModule_etc...) you want to add to the PAM of (e.g. PartComponentModule_ResourceConverter)
ModuleDisplayName: "Your/Localized/Name", // This is the localization key of your modules PAM name
ShowHeader: true, // Whether or not you want to show the header in the PAM
ShowFooter: false // Whether or not you want to show the footer in the PAM
}
// You can add more modules by adding more comma separated blocks like above
];
// If you wish to change how your module is sorted as well
PAMModuleSortOverride: +[
{
PartComponentModuleName: "...", // This is the module (usually of the form PartComponentModule_etc...) you want to change the sorting of (e.g. PartComponentModule_ResourceConverter)
sortIndex: 40 // This is the sort index in the PAM for your part, you have to fine tune this yourself, 40 is a good starting point
}
// You can add more overrides by adding more comma separated blocks like above
];
}There may be times where you want to add a module whose values depend on those in another module, or only if it has another module and a value in that module is above a specific number. For this you are going to want to use capture selectors, a variant of the .class selector meant for you to run code in the selector to add variables to the current scope and the like. The syntax for this selector is .class:[...] where ... is a semicolon separated (and terminated) list of statements running inside the "scope" of the module. To put this into use in an example for the purposes of the tutorial, we are going to capture the communication range of parts that have an antennae, and add a custom module with this communication range.
// This is going to be a part based selection
:parts {
// Now let's do our "class capture", the .Module_DataTransmitter is the module for an antenna
.Module_DataTransmitter:[
$commRange: $$CommunicationRange; // And this is our capture, where we are capturing the object local value $$CommunicationRange from the Antenna module, and storing it in a scope local variable of $commRange
] {
// In this scope $commRange is accessable, but $$CommunicationRange is not
// Add the module like usual
+Module_Test {
// And the data
+Data_Test {
// Setting the value of Test inside the data to our captured value
Test: $commRange;
}
}
}
}[TBD]