Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations JAE on being selected by the Eng-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
Joined
Jul 28, 2015
Messages
30
Location
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
 
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.

Part and Inventory Search

Sponsor

Back
Top