ArchCommands Namespace Reference

Utility functions for theArch Workbench. More...


def addComponents (objectsList, host)
def check (objectslist, includehidden=False)
def cleanArchSplitter (objects=None)
def cloneComponent (obj)
def closeHole (shape)
def copyProperties (obj1, obj2)
def download (url, force=False)
def fixDAG (obj)
def getCutVolume (cutplane, shapes)
def getDefaultColor (objectType)
def getExtrusionData (shape)
def getHost (obj, strict=True)
def getShapeFromMesh (mesh, fast=True, tolerance=0.001, flat=False, cut=True)
def getStringList (objects)
def makeComponent (baseobj=None, name="Component", delete=False)
def makeCompoundFromSelected (objects=None)
def makeFace (wires, method=2, cleanup=False)
def makeIfcSpreadsheet (archobj=None)
def mergeCells (objectslist)
def meshToShape (obj, mark=True, fast=True, tol=0.001, flat=False, cut=True)
def printMessage (message)
def printWarning (message)
def projectToVector (shape, vector)
def pruneIncluded (objectslist, strict=False)
def rebuildArchShape (objects=None)
def removeComponents (objectsList, host=None)
def removeCurves (shape, dae=False, tolerance=5)
def removeShape (objs, mark=True)
def setAsSubcomponent (obj)
def splitMesh (obj, mark=True)
def survey (callback=False)
def toggleIfcBrepFlag (obj)

Detailed Description

Utility functions for theArch Workbench.

This module provides general functions used by Arch tools and utility commands

Function Documentation

def ArchCommands.addComponents (   objectsList,
addComponents(objectsList,hostObject): adds the given object or the objects
from the given list as components to the given host Object. Use this for
example to add windows to a wall, or to add walls to a cell or floor.

References Draft.getType(), and DraftGeomUtils.isValidPath().

Referenced by

def ArchCommands.check (   objectslist,
  includehidden = False 
check(objectslist,includehidden=False): checks if the given objects contain only solids

References Draft.getGroupContents(), Draft.getType(), and Draft.removeHidden().

Referenced by printWarning().

def ArchCommands.cleanArchSplitter (   objects = None)
cleanArchSplitter([objects]): removes the splitters from the base shapes
of the given Arch objects or selected Arch objects if objects is None
def ArchCommands.cloneComponent (   obj)
cloneComponent(obj): Creates a clone of an object as an undefined component

References makeComponent().

def ArchCommands.closeHole (   shape)
closeHole(shape): closes a hole in an open shape

Referenced by printWarning().

def ArchCommands.copyProperties (   obj1,
copyProperties(obj1,obj2): Copies properties values from obj1 to obj2,
when that property exists in both objects
def (   url,
  force = False 
download(url,force=False): downloads a file from the given URL and saves it in the
macro path. Returns the path to the saved file. If force is True, the file will be
downloaded again evn if it already exists.

Referenced by importDXF.errorDXFLib(), and importIFClegacy.getSchema().

def ArchCommands.fixDAG (   obj)
fixDAG(object): Fixes non-DAG problems in windows and rebars
by removing supports and external geometry from underlying sketches

References Draft.getType().

Referenced by ArchRebar.makeRebar(), and removeComponents().

def ArchCommands.getCutVolume (   cutplane,
getCutVolume(cutplane,shapes): returns a cut face and a cut volume
from the given shapes and the given cutting plane

References DraftVecUtils.project(), and DraftVecUtils.scaleTo().

Referenced by ArchVRM.Renderer.cut(), ArchCutPlane.cutComponentwithPlane(), ArchSectionPlane.getCutShapes(), ArchPipe.makePipeConnector(), and ArchSpace.removeSpaceBoundaries().

def ArchCommands.getDefaultColor (   objectType)
getDefaultColor(string): returns a color value for the given object
type (Wall, Structure, Window, WindowGlass)

References Draft.getParam().

Referenced by ArchPanel.CommandPanelSheet.Activated(), ArchWall.areSameWallTypes(), ArchRebar.makeRebar(), ArchStructure.makeStructuralSystem(), ArchWindow.makeWindowPreset(), and setAsSubcomponent().

def ArchCommands.getExtrusionData (   shape)
getExtrusionData(shape): returns a base face and an extrusion vector
if this shape can be described as a perpendicular extrusion, or None if not.

Referenced by ArchComponent.Component.getExtrusionData().

def ArchCommands.getHost (   obj,
  strict = True 
getHost(obj,[strict]): returns the host of the current object. If strict is true (default),
the host can only be an object of a higher level than the given one, or in other words, if a wall
is contained in another wall which is part of a floor, the floor is returned instead of the parent wall

References Draft.getType().

def ArchCommands.getShapeFromMesh (   mesh,
  fast = True,
  tolerance = 0.001,
  flat = False,
  cut = True 
def ArchCommands.getStringList (   objects)
getStringList(objects): returns a string defining a list
of objects

Referenced by ArchAxis.makeAxis(), and ArchStructure.makeStructuralSystem().

def ArchCommands.makeComponent (   baseobj = None,
  name = "Component",
  delete = False 
makeComponent([baseobj]): creates an undefined, non-parametric Arch
component from the given base object

Referenced by cloneComponent().

def ArchCommands.makeCompoundFromSelected (   objects = None)
makeCompoundFromSelected([objects]): Creates a new compound object from the given
subobjects (faces, edges) or from the the selection if objects is None
def ArchCommands.makeFace (   wires,
  method = 2,
  cleanup = False 
makeFace(wires): makes a face from a list of wires, finding which ones are holes

References DraftGeomUtils.removeInterVertices().

Referenced by ArchPanel.CommandPanelSheet.Activated(), getShapeFromMesh(), and ArchVRM.Renderer.projectFace().

def ArchCommands.makeIfcSpreadsheet (   archobj = None)

References Draft.getType().

def ArchCommands.mergeCells (   objectslist)
mergeCells(objectslist): merges the objects in the given list
into one. All objects must be of the same type and based on the Cell
object (cells, floors, buildings, or sites).

References Draft.getType().

Referenced by printWarning().

def ArchCommands.meshToShape (   obj,
  mark = True,
  fast = True,
  tol = 0.001,
  flat = False,
  cut = True 
meshToShape(object,[mark,fast,tol,flat,cut]): turns a mesh into a shape, joining coplanar facets. If
mark is True (default), non-solid objects will be marked in red. Fast uses a faster algorithm by
building a shell from the facets then removing splitter, tol is the tolerance used when converting
mesh segments to wires, flat will force the wires to be perfectly planar, to be sure they can be
turned into faces, but this might leave gaps in the final shell. If cut is true, holes in faces are
made by subtraction (default)

References getShapeFromMesh().

Referenced by printWarning().

def ArchCommands.printMessage (   message)
def ArchCommands.projectToVector (   shape,
projectToVector(shape,vector): projects the given shape on the given

References DraftVecUtils.project(), and DraftVecUtils.scaleTo().

Referenced by ArchRebar.makeRebar().

def ArchCommands.pruneIncluded (   objectslist,
  strict = False 
pruneIncluded(objectslist,[strict]): removes from a list of Arch objects, those that are subcomponents of
another shape-based object, leaving only the top-level shapes. If strict is True, the object
is removed only if the parent is also part of the selection.

References Draft.getType().

def ArchCommands.rebuildArchShape (   objects = None)
rebuildArchShape([objects]): takes the faces from the base shape of the given (
or selected if objects is None) Arch objects, and tries to rebuild a valid solid from them.
def ArchCommands.removeComponents (   objectsList,
  host = None 
removeComponents(objectsList,[hostObject]): removes the given component or
the components from the given list from their parents. If a host object is
specified, this function will try adding the components as holes to the host
object instead.

References fixDAG(), Draft.getType(), and setAsSubcomponent().

Referenced by ArchCutPlane.cutComponentwithPlane(), and

def ArchCommands.removeCurves (   shape,
  dae = False,
  tolerance = 5 
removeCurves(shape,dae,tolerance=5): replaces curved faces in a shape
with faceted segments. If dae is True, DAE triangulation options are used

References getShapeFromMesh(), and importDAE.triangulate().

def ArchCommands.removeShape (   objs,
  mark = True 
removeShape(objs,mark=True): takes an arch object (wall or structure) built on a cubic shape, and removes
the inner shape, keeping its length, width and height as parameters. If mark is True, objects that cannot
be processed by this function will become red.

References DraftGeomUtils.getCubicDimensions(), Draft.getType(), DraftGeomUtils.isCubic(), Draft.makeLine(), ArchStructure.makeStructure(), and ArchWall.makeWall().

Referenced by printWarning().

def ArchCommands.setAsSubcomponent (   obj)
Sets the given object properly to become a subcomponent (addition, subtraction)
of an Arch component

References getDefaultColor(), and Draft.ungroup().

Referenced by removeComponents(), and ArchComponent.removeFromComponent().

def ArchCommands.splitMesh (   obj,
  mark = True 
splitMesh(object,[mark]): splits the given mesh object into separated components.
If mark is False, nothing else is done. If True (default), non-manifold components
will be painted in red.

Referenced by printWarning().

def ArchCommands.survey (   callback = False)
survey(): starts survey mode, where you can click edges and faces to get their lengths or area.
Clicking on no object (on an empty area) stops survey mode.
def ArchCommands.toggleIfcBrepFlag (   obj)
toggleIfcBrepFlag(obj): toggles the IFC brep flag of the given object, forcing it
to be exported as brep geometry or not.

Referenced by printWarning().