public abstract class AutocadScript extends Object implements Serializable
Contains functionalities common to all types of scripts
Modifier and Type | Class and Description |
---|---|
static class |
AutocadScript.TextAnchor
The available anchor types for text.
|
Constructor and Description |
---|
AutocadScript() |
Modifier and Type | Method and Description |
---|---|
BigDecimal |
getDefaultFontSize() |
BigDecimal |
getDefaultScaleFactor() |
AutocadScript.TextAnchor |
getDefaultTextAnchor() |
StringBuilder |
getSb() |
Set<String> |
getUsedFiles() |
void |
insertArbitraryCommand(String command)
Adds an arbitrary command.
|
void |
setDefaultFontSize(BigDecimal fontsize)
Sets the default font size.
|
void |
setDefaultScaleFactor(BigDecimal scale_factor)
Sets the default scale factor.
|
void |
setDefaultTextAnchor(AutocadScript.TextAnchor anchor)
Sets the default anchor type for texts.
|
void |
setSb(StringBuilder sb) |
void |
setUsedFiles(Set<String> usedFiles) |
void |
updateBlockAttributeValue(String blockName,
String tagName,
String oldValue,
String newValue)
Updates an attribute value.
|
public BigDecimal getDefaultFontSize()
public BigDecimal getDefaultScaleFactor()
public AutocadScript.TextAnchor getDefaultTextAnchor()
public StringBuilder getSb()
public void insertArbitraryCommand(String 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.
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.public void setDefaultFontSize(BigDecimal fontsize)
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.
fontsize
- The font size to be used as the defaultpublic void setDefaultScaleFactor(BigDecimal 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.
scale_factor
- The scale factor to be used as the defaultpublic void setDefaultTextAnchor(AutocadScript.TextAnchor anchor)
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.
anchor
- The anchor type to be used as the defaultpublic void setSb(StringBuilder sb)
${param}
- to setpublic void updateBlockAttributeValue(String blockName, String tagName, String oldValue, String newValue)
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.
blockName
- The block name of the attributetagName
- The tag name of the attributeoldValue
- 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