bim:save-material


(bim:save-material name  data  [ global ])

This function saves the material definition under the specified material name, in the document library (default), or in the global library.

Arguments

name  (string) the case-sensitive name of the material to be saved (priority over the material name as specified in data list)

data  (assoc list) the material parameters list in the format as returned by the (bim:get-material) function

global  (optional, default NIL) if 'global' is specified and non-NIL, the material is saved in the global database, otherwise saved in the document-specific library

Return

T if the save operation was successful, NIL otherwise

Example

(setq data (bim:get-material "Gold"))
(("Name" . "Gold") ("Desc" . "") ("Comment" . "") ("Appearance" . "Gold") ("CH_Name" . "ANSI31") ("CH_Scale" . 1.0) ("CH_Angle" . 0.0) ("CH_Cross" . 0) ("CH_Anno" . 0) ("CH_Type" . 1) ("SH_Name" . "SOLID") ("SH_Scale" . 1.0) ("SH_Angle" . 0.0) ("SH_Cross" . 0) ("SH_Anno" . 0) ("SH_Type" . 1))

(setq data (subst (cons "CH_Scale" 2.0) (assoc "CH_Scale" data) data))
(("Name" . "Gold") ("Desc" . "") ("Comment" . "") ("Appearance" . "Gold") ("CH_Name" . "ANSI31") ("CH_Scale" . 2.0) ("CH_Angle" . 0.0) ("CH_Cross" . 0) ("CH_Anno" . 0) ("CH_Type" . 1) ("SH_Name" . "SOLID") ("SH_Scale" . 1.0) ("SH_Angle" . 0.0) ("SH_Cross" . 0) ("SH_Anno" . 0) ("SH_Type" . 1))

(bim:save-material "Gold_2" data)  T

Remarks

the structure of the data list must be the same as retrieved by the (bim:get-material) function;
the specified name has priority over the name as specified in ("Name" . name);
the material name and all parameter values are case-sensitive !



©  Bricsys NV. All rights reserved.