NC Manufacturing Functions: MfgFunctionsPackage Functions

This section describes the NC Manufacturing functions.

For rules allowing you to sequence operations: once you define the rules, you can select them in the dialog box that appears when clicking Auto Sequence from the Analysis & Output section of the action bar.

This page discusses:

CreateMachiningFeature

Creates a manufacturing prismatic feature.

Signature

CreateMachiningFeature(Type : String) : Feature

Arguments

Name Input/Output Required? Type Comment
Type In Yes String Type of feature.

ReturnType

Feature

Example

"Let MFeature(ManufacturingFeature)     

[...] 	
Set MFeature = CreateMachiningFeature("MfgPrismaticSlab")

CreatePatternUsage

Creates a pattern usage.

Signature

CreatePatternUsage(Pattern : MfgPatternUsage) : Boolean

Arguments

Name Input/Output Required? Type Comment
Pattern Out Yes MfgPatternUsage -

ReturnType

Boolean

Example

Let MOperation(ManufacturingOperation)    
Let MFeature(MfgPatternUsage)  

[...]		
Set MOperation = MP.AppendOperation("Drilling", False )	
CreatePatternUsage(MFeature)	
MOperation.SetPatternUsage( MFeature )"

CreateSeqMotion

Creates a sequential motion object.

Signature

CreateSeqMotion(Type : String, Feature : MfgSeqMotionPPWord) : Boolean

Arguments

Name Input/Output Required? Type Comment
Type In Yes String Type of motion to create.
Feature Out Yes MfgSeqMotionPPWord Created sequential motion. It can be a point to point site, a PP Word sequential motion, or a sequential motion lathe base.

ReturnType

Boolean

Example

let MPtSite(MfgPtToPtSite)    
let MPtSitePPWord(MfgSeqMotionPPWord)  
let MGoStd(MfgSeqMotionLatheBase) 

[...]     
CreateSeqMotion("MfgPtToPtSite",MPtSite)   
CreateSeqMotion("MfgSeqMotionPPWord", MPtSitePPWord)  
CreateSeqMotion("MfgSeqMotionLatheDelta",MGoStd)

ExecuteAutoSequence

Executes the auto-sequence and sequences the specified operations using the active rules defined in the current rule set. You can modify the active rules of the current auto-sequence using Rules Manager from the Programming section or the action bar or using the SetActiveAutoSequenceRules function. You can modify the active rules and their priorities using SetActiveAutoSequenceRules and then ExecuteAutoSequence. To restore the previous rules, use the GetActiveAutoSequenceRules function.

Signature

ExecuteAutoSequence(ActivityList : List, MinimizeChange : Boolean) : Boolean

Arguments

Name Input/Output Required? Type Comment
ActivityList In Yes List Lists the operations to sequence. You can include entries for manufacturing operations or manufacturing programs.
MinimizeChange In Yes Boolean Minimizes the tool change when auto-sequence is run.

ReturnType

Boolean

Example

Let ActivityList(List) 
Let Program(ManufacturingProgram)
// code for getting Program or it can also be input argument

ActivityList.Append(Program)

ExecuteAutoSequence(ActivityList, true)

Example: Restoring the Previous Rules

InitAutoSequenceOperationTypePriorities() 
// Note: Above function call is needed because of the rule: “Sort_by_Activity_Type”
Let OrigRuleNames(List)
Let OrigRulePriorities(List)
GetActiveAutoSequenceRules(OrigRuleNames, OrigRulePriorities)

Let RuleNames(List)
RuleNames.Append("Sort_by_Distance")
RuleNames.Append("Sort_by_Activity_Type")

Let RulePriorities(List)
RulePriorities.Append(40)
RulePriorities.Append(30)

SetActiveAutoSequenceRules(RuleNames, RulePriorities)

Let ActList(List)
ActList.Append(Program)
ExecuteAutoSequence(ActList, true)

SetActiveAutoSequenceRules(OrigRuleNames, OrigRulePriorities)

  • The program variable corresponds to the input argument. The type corresponds to a manufacturing program. When you call this function with the specified code above, you can define any manufacturing program by selecting it in the tree.
  • When calling GetActiveAutoSequenceRules for the first time, the active rules are retrieved from the current rule set.
  • The ExecuteAutoSequence function sequences the program using the active rules of the current rule set, previously set when calling the SetActiveAutoSequenceRules function.
  • The previous values of the active rules are eventually restored when using the SetActiveAutoSequenceRules function.

GetActiveAutoSequenceRules

Returns the active rules from the current auto-sequence rule set. Specify the current auto-sequence rule set before calling this function. Alternatively, you can specify the current auto-sequence rule set by selecting the "..." icon in Me > Preferences > Machining > Program. If no rule set is present in the database, first import a rule set and then set it as the current auto-sequence rule set.

Signature

GetActiveAutoSequenceRules(RuleNames : List, RulePriorities : List) : Boolean

Arguments

Name Input/Output Required? Type Comment
RuleNames Out Yes List List of strings for rule names
RulePriorities Out Yes List List of integers for rule priorities

ReturnType

Boolean

Example

Let RuleNames(List) 
Let RulePriorities(List) 
GetActiveAutoSequenceRules(RuleNames, RulePriorities)

GetPriority

Returns the priority value of the operation type for auto-sequencing.

Before calling the function, call InitAutoSequenceOperationTypePriorities or SetPriority functions to initialize auto-sequencing with priority values for all the operation types.

The values persist in session only. You can modify them by calling the SetPriority function. In this case, the operation type priority value returned might differ from the persistent values displayed in the panel that appears when clicking Rules Manager from the Programming section of the action bar.

Signature

GetPriority(OperationType : String) : Integer

Arguments

Name Input/Output Required? Type Comment
OperationType In Yes String -

ReturnType

Integer

Example

Let Operation(ManufacturingActivity) 
Let PriorityValue(Integer)
Let OpType(String)
Operation->GetType(OpType)
[...]

set PriorityValue = GetPriority(OpType)

InitAutoSequenceOperationTypePriorities

Initializes the auto-sequencing of operations with priority values for all the operation types.

The values initialized are the same than the ones displayed in the panel that appears when clicking Rules Manager from the Programming section of the action bar.

For a "Sort_by_Activity_Type" rule, call the ExecuteAutoSequence function first.

Signature

InitAutoSequenceOperationTypePriorities() : Boolean

ReturnType

Boolean

Example

Let Operation(ManufacturingActivity) 
Let PriorityValue(Integer)
Let OpType(String)
Operation->GetType(OpType)
[...]

set PriorityValue = GetPriority(OpType)

SetActiveAutoSequenceRules

Sets the active rules and their priorities to the current auto-sequence rule set. Specify the current auto-sequence rule set before calling this function. Alternatively, you can specify the current auto-sequence rule set by using the "..." icon in Me > Preferences > Machining > Program. It no rule set is present in the database, import a rule set first and set is as the current auto-sequence rule set.

Signature

SetActiveAutoSequenceRules(RuleNames : List, RulePriorities : List) : Boolean

Arguments

Name Input/Output Required? Type Comment
RuleNames In Yes List List of character strings. The rule name does not need to be a full character string. You can specify a sub-string such as "Sort_by_Distance" as long as this sub-string belongs to a single rule.
RulePriorities In Yes List List of integers for rule priorities.

ReturnType

Boolean

Example

Let RuleNames(List) 
Let RulePriorities(List) 

RuleNames.Append("Sort_by_Distance")
RuleNames.Append("Sort_by_Tool_Change")
 // add some more rules if needed

RulePriorities.Append(40)
RulePriorities.Append(80)
// add priorities for some more rules if needed

SetActiveAutoSequenceRules(RuleNames, RulePriorities)

Recommendations:

  • Define as many RuleNames entries as RulePriorities entries.
  • The RuleNames list should contain names of active rules. To check the name of the rules, search for the rule set using the search of the Top Bar.

SetPriority

Sets the operation type priority value for auto-sequencing.

The values persist in session only. Calling GetPriority function returns the value set by a previous call of this function.

Signature

SetPriority(OperationType : String, PriorityValue : Integer) : Integer

Arguments

Name Input/Output Required? Type Comment
OperationType In Yes String -
PriorityValue In Yes Integer -

ReturnType

Integer

Example

Let Operation(ManufacturingActivity) 
Let OpType(String)
Let PriorityValue(Integer)
[...]

Operation->GetType(OpType)
set PriorityValue = 50
SetPriority(OpType, PriorityValue)

NCMachiningTemplate.CreateMachiningProcess()

Creates a machining process in a task template.

Signature

NCMachiningTemplate.CreateMachiningProcess() : MachiningProcess

ReturnType

MachiningProcess

Example

/* Let NCMTemplate be the input argument of type NCMachiningTemplate*/  	
Let MMachiningProcess(MachiningProcess)
		
[...]   
Set MMachiningProcess = NCMTemplate.CreateMachiningProcess()

NCMachiningTemplate.GetMachiningProcessList()

Returns the machining process contained in a task template.

Signature

NCMachiningTemplate.GetMachiningProcessList(List of Machining Process : List) : MachiningProcess

Arguments

Name Input/Output Required? Type Comment
List of Machining Process Out Yes List -

ReturnType

MachiningProcess

Example

/* Let NCMTemplate be the input argument of type NCMachiningTemplate*/  	
Let listMP(List)
		
[...]   
Set MMachiningProcess = NCMTemplate.GetMachiningProcessList(listMP)

VPMInstance.AddConfig()

Creates an FSConfig feature on a tool, tool assembly and insert, with the given keys.

Signature

VPMInstance.AddConfig(Key1 : String, Key2 : String, Key3 : String, FS Configuration : MfgFSConfiguration) : Boolean

Arguments

Name Input/Output Required? Type Comment
Key1 In Yes String First identifier.
Key2 In Yes String Second identifier.
Key3 In Yes String Third identifier.
FS Configuration Out Yes MfgFSConfiguration Returns the created feature. If a configuration already exists with the given keys, it returns the related feature.

ReturnType

Boolean

Example

Let Tool(VPMInstance)  
Let FSConfig(MfgFSConfiguration) 

[...]     
Tool.AddConfig("KeyOne", "KeyTwo", "KeyThree", FSConfig)

VPMReference.AddConfig()

Signature

VPMReference.AddConfig(Key1 : String, Key2 : String, Key3 : String, FS Configuration : MfgFSConfiguration) : Boolean

Arguments

Name Input/Output Required? Type Comment
Key1 In Yes String -
Key2 In Yes String -
Key3 In Yes String -
FS Configuration Out Yes MfgFSConfiguration -

ReturnType

Boolean