Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating ".CATMaterial." by using CATIA VB

Status
Not open for further replies.

sriharsha1994

Mechanical
Jul 28, 2015
30
0
0
IN
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
 
Replies continue below

Recommended for you

I have written the following code.This is creating MaterialFamilies and Materials,but how can I set the names of the Material families and Materials..Plz help me


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()
 
Status
Not open for further replies.
Back
Top