The CNC module
The CNC module provides methods that let you generate CNC download files using parametrics. Four methods are provided so that you can output member or material CNC files with or without setup. The 1st argument for all four methods takes a list [of members or materials, depending on the method]. If the list in the first argument is empty, running the parametric opens a selection dialog. The 2nd argument takes a string that is a path. The two DownLoad...WithSetup methods take a 3rd argument , which takes the CNC.Setup() method for specifying the " CNC configuration ." DownloadMembersWithSetup() shown in the example below is one of the four methods. Click here for help on all four methods.
DownloadMembersWithSetup( arg1 , arg2 , arg3 )
|
# Downloads member 'B_1' using default cnc setup to folder 'cnc_output'
import CNC
|
# Downloads members 1B1& 23C, materials a1 & a2 & w3 & w4
from CNC import CNCMaterial
mt_list = [ "a1", "a2", "w3", "w4" ]
|
# Downloads members 1B1& 23C, materials a1 & a2 & w3 & w4
from CNC import CNCMaterial
mt_list = [ "a1", "a2", "w3", "w4" ]
if os.path.isdir(mtrl_path) == False:
if os.path.isdir(mem_path) == False:
CNCMaterial( mt_list, mtrl_path )
## If you pass an empty list to either method you will get the
CNCMaterial( [], "")
|
To get help on the CNC module , you can use the SDS2 Python Prompt and the built-in Python functions dir() and help() :
SDS2 Python Prompt |
>>> import CNC # import the module
CNCMaterial(...)
>>> help(CNCMember) # help on CNCMember
CNCMember(...)
>>> help(DownloadMaterialsWithSetup) # help
DownloadMaterialsWithSetup(...)
>>> help(DownloadMembersWithSetup) # help
DownloadMembersWithSetup(...)
|