How to add your knowledge

BaseDesign

    Table of contents
    1. 1. Synopsis
    2. 2. Mixins
    3. 3. Parameters
    4. 4. Rules
    5. 5. Methods
    6. 6. Example 1
    7. 7. Example 2

    Synopsis

    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.

    Mixins

    BaseDesignModifier

    Parameters

    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).
    NoteIn 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.

    Rules

    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.

    Methods

    hasRule?( ruleName As Name ) As Boolean
    This method is used to determine if this design has a rule named ruleName.

    isBound?( ruleName As Name ) As Boolean
    This method is used to check and see if the rule on the design, ruleName, has been evaluated or not.

    isKindOf?( designName As Name ) As Boolean
    This method is used to determine if this part's design has a designName design mixed into it.

    Example 1

    Name: BaseDesign_Ex01
    Design: acDrawingDocument
    NameTypeFormula
    cost number
    If me.isBound?(:costCalculated) Then 
    	 costCalculated 
    Else 
      costEstimated 
    End If
    costEstimated number 5.0
    costCalculated number 5.17

    Example 2

    Write part parameters out to a text file.

    Name: BaseDesign_Ex02
    Design: acDrawingDocument
    NameTypeFormula
    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
    NameTypeSupplied
    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
    NameTypeSupplied
    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
    NameTypeSupplied
    height number 42
    length number 16
    width number 10
    v000 point Point(24.0, 4.0, 0.0)