This design contains the minimum set of rules needed to make an instantiable design . Any new design , which you want to directly instantiate, must include BaseDesign as a minimum. Mixin designs , which are not intended to be directly instantiated, do not need to include BaseDesign. However, the design into which they are mixed must ultimately include BaseDesign. Designs which mix in only BaseDesign and not BasePart are generally not viewable by Intent. To add or change rules on all designs globally, the BaseDesignModifier design can be overridden. Overriding the design can be accomplished by creating a new design with the name BaseDesignModifier and placing it in the project library or another library that has precedence over the kernel library. New rules can then be added to this design .
BaseDesignModifier
Name | Type | Description |
---|---|---|
givenName | any | An alternate name by which to reference the part. If supplied, the givenName must be unique among all the siblings. The givenName may be supplied as either a name or a
string
and appears in the assembly tree (unless displayName is also supplied).
Note: In order to reference a part by givenName you must set EnableHasChildNamed to 1.
|
displayName | string | Name of the part actually shown in the assembly tree. This name cannot be used as an alternative name in a reference. The default is partName. |
Name | Type | Description |
---|---|---|
self | part | Provides the current part of the design . |
children | list | Returns a list of parts representing the next level down in the hierarchy. This rule may be overridden by higher-level designs using the children() function or not, as desired. |
isNull? | boolean | Returns True if this is an instance of a NullDesign. |
refChain | string | Returns the reference chain to the part . |
ruleName | name | Returns the name of the part . This may differ from the name that appears in the assembly tree if either givenName or displayName are supplied. |
designName | name | Name of the part's design. The function returns the highest design in the hierarchy, not the mixin designs . |
partParameters | list | Returns a list of names of the supplied parameters. |
first? | boolean | Returns True if this is the last member of a child list . |
childListLength | integer | Returns the number of members in the child list . If the child is not a member of a child list , NoValue is returned. |
isChildListMember? | boolean | Returns True if this is a member of a child list . |
last? | boolean | Returns True if this is the last member of a child list . |
first | part | The first member of the child list . If the part is not a member of a child list , NoValue is returned. |
previous | part | The previous member of the child list (e.g. child.index - 1). If the part is not a member of a child list , or the current child is the first member of the child list , NoValue is returned. |
cyclicPrevious | part | Returns the previous member of the child list . If the current child is the first member of the child list , the last member of the child list is returned. If the part is not a member of a child list , NoValue is returned. |
cyclicNext | part | Returns the next member of the child list . If the current child is the last member of the child list , the first member of the child list is returned. If the part is not a member of a child list , NoValue is returned. |
next | part | The next member of the child list (e.g. child.index + 1). If the part is not a member of a child list , or the current child is the last member of the child list , NoValue is returned. |
last | part | The last member of the child list . If the part is not a member of a child list , NoValue is returned. |
hasRule?( ruleName As Name ) As BooleanUse this method to determine if this design has a rule named ruleName.
isBound?( ruleName As Name ) As BooleanUse this method to check and see if the rule on the design , ruleName, has been evaluated or not.
isKindOf?( designName As Name ) As BooleanUse this method to determine if this part's design has a designName design mixed into it.
safeRef(ruleName As Any, Optional onErrorValue As Any = NoValue) As AnyUse this method to safely reference ruleName. If there is an error, onErrorValue is returned, which is NoValue by default.
safeRefMethod(ruleName As Any, args As List, Optional onErrorValue As Any = NoValue) As AnyUse this method to safely reference a method named ruleName. Pass the arguments in order in the args list . If there is an error, onErrorValue is returned, which is NoValue by default.
Name : | BaseDesign_Ex01 | |
Design : | acDrawingDocument | |
Name | Type | Formula |
cost | number |
If me.isBound?(:costCalculated) Then costCalculated Else costEstimated End If |
costEstimated | number | 5.0 |
costCalculated | number | 5.17 |
Write part parameters out to a text file.
Name : | BaseDesign_Ex02 | |
Design : | acDrawingDocument | |
Name | Type | Formula |
childParams | any |
Dim f As User = openFile("C:\My Documents\Child part parameters.txt", :Write) Write("Child part parameters:" & newline(), f) For Each prt In children Write(" " & prt.designName & newline(), f) Dim params As List = prt.partParameters For Each param In params Dim val As String = stringValue(ref(prt,param)) Write(" " & param & " = " & val & newline(), f) Next param Next prt closeFile(f) |
Child Name : | block_1 | |
Child Design : | :Block | |
Name | Type | Supplied |
height | number | 42 |
length | number | 16 |
width | number | 10 |
v000 | point | Point(0.0, 0.0, 0.0) |
Child Name : | block_2 | |
Child Design : | :Block | |
Name | Type | Supplied |
height | number | 42 |
length | number | 16 |
width | number | 10 |
v000 | point | Point(12.0, 2.0, 0.0) |
Child Name : | block_3 | |
Child Design : | :Block | |
Name | Type | Supplied |
height | number | 42 |
length | number | 16 |
width | number | 10 |
v000 | point | Point(24.0, 4.0, 0.0) |