Class AutocadScript

java.lang.Object
com.imc.iss.groovy.autocad.AutocadScript
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AutocadScript2D

public abstract class AutocadScript extends Object implements Serializable
The base class representing the script to be executed to generate the AutoCAD drawing.

Contains functionalities common to all types of scripts

See Also:
  • Constructor Details

    • AutocadScript

      public AutocadScript()
  • Method Details

    • getDefaultFontSize

      public BigDecimal getDefaultFontSize()
      Returns:
      the defaultFontSize
    • getDefaultScaleFactor

      public BigDecimal getDefaultScaleFactor()
      Returns:
      the defaultScaleFactor
    • getDefaultTextAnchor

      public AutocadScript.TextAnchor getDefaultTextAnchor()
      Returns:
      the defaultTextAnchor
    • getSb

      public StringBuilder getSb()
      Returns:
      the sb
    • getUsedFiles

      public Set<String> getUsedFiles()
      Returns:
      the usedFiles
    • insertArbitraryCommand

      public void insertArbitraryCommand(String command)
      Adds an arbitrary command.

      This feature allows you to execute any command available in AutoCAD to generate the drawing, beyond the commands that are currently officially supported by In Mind Cloud. Use at your own risk.

      A line break is automatically added at the end.

      Parameters:
      command - The arbitrary command. May consist of multiple lines separated by line breaks (the "\n" character). A line break will be automatically added at the end.
    • setDefaultFontSize

      public void setDefaultFontSize(BigDecimal fontsize)
      Sets the default font size.

      When a text is to be printed through a supported method without specifying the font size, the text will be printed with this font size.

      Note, this does NOT change the actual default font size of the text style of the DWG file.

      Parameters:
      fontsize - The font size to be used as the default
    • setDefaultScaleFactor

      public void setDefaultScaleFactor(BigDecimal scale_factor)
      Sets the default scale factor.

      When a drawing is imported without specifying the scale factor, this default value will be used instead. This is mainly used if the base DWG file and the drawing to be imported have different units, and thus needs to be scaled.

      The initial value is 1, thus if all the drawings are of the same unit, this does not need to be specified.

      Parameters:
      scale_factor - The scale factor to be used as the default
    • setDefaultTextAnchor

      public void setDefaultTextAnchor(AutocadScript.TextAnchor anchor)
      Sets the default anchor type for texts.

      When a text is to be printed through a supported method without specifying the anchor type, the text will be printed with this anchor.

      Note, this does NOT change the actual default anchor type of the text style of the DWG file.

      Parameters:
      anchor - The anchor type to be used as the default
    • setSb

      public void setSb(StringBuilder sb)
      Parameters:
      $ - {param} to set
    • setUsedFiles

      public void setUsedFiles(Set<String> usedFiles)
      Parameters:
      $ - {param} to set
    • updateBlockAttributeValue

      public void updateBlockAttributeValue(String blockName, String tagName, String oldValue, String newValue)
      Updates an attribute value.

      The attribute will be identified by its block and tag. If there are multiple attributes that meets that criteria, all of them will be updated. Due to the limitation in the AutoCAD function used, the part of the old value that will be replaced has to be provided.

      Parameters:
      blockName - The block name of the attribute
      tagName - The tag name of the attribute
      oldValue - The part of the current value of the attribute that will be replaced. It can be just a specific portion of the current value, or the whole if everything is to be replaced.
      newValue - The new value that will replace the given old value in the attribute