Creating ".CATMaterial." by using CATIA VB
Creating ".CATMaterial." by using CATIA VB
(OP)
Hi Everyone,
I know that we can open an existing ".CATMaterial" file and edit it like Adding Materials,Material familes using CATIA VB APIs..But Is it possible to create a new ".CATMaterial" file by using CATIA VB?.I need to add Material family,Materials and then also set properties for each material.I tried opening an existing .CATMaterial file ,removing Material familes but it says ".CATMaterial" file should consists atleast one MaterialFamily.This undermines my main objective. Any help will be appreciated.
Thanks
I know that we can open an existing ".CATMaterial" file and edit it like Adding Materials,Material familes using CATIA VB APIs..But Is it possible to create a new ".CATMaterial" file by using CATIA VB?.I need to add Material family,Materials and then also set properties for each material.I tried opening an existing .CATMaterial file ,removing Material familes but it says ".CATMaterial" file should consists atleast one MaterialFamily.This undermines my main objective. Any help will be appreciated.
Thanks





RE: Creating ".CATMaterial." by using CATIA VB
Dim CATIA As INFITF.Application
CATIA = GetObject(, "CATIA.Application")
If CATIA Is Nothing Then
CATIA = CreateObject("CATIA.Application")
End If
Dim docuemnts As Documents
docuemnts = CATIA.Documents
Dim Materialdocument As Document = docuemnts.Add("CATMaterial")
Dim MaterialDoc As MaterialDocument
MaterialDoc = CType(Materialdocument, Document)
Dim MaterialFamilies As MaterialFamilies = MaterialDoc.Families
Dim MaterialFamily As MaterialFamily = MaterialFamilies.Add()
Dim materials As Materials = MaterialFamily.Materials
Dim material As Material = materials.Add()