Software Use > Scripting

Adding material to project

<< < (2/3) > >>

Ryan:
The array you defined as two entries: strVarMaterial(0) & strVarMaterial(1).

The strVarMaterial(1) entry is not defined which causes the application error.

The VariableMaterial property will ignore the zero index array term. So to add a single material, do this instead:

ReDim strVarMaterial(1 To 1)
strVarMaterial(1) = HS.Laminates.Item(3).Key

Also, note that the array above is dimensioned using an upper and lower bound. It is best practice in VBA to define the arrays this way rather than relying on whatever default is (Option Base).

oseresta:
Thanks Ryan. It helped a lot.

One last question.

1. Is it possible to add a orthotropic material thru Object Model.

I didnt see any public method that says create for oHS.Orthotropics.#####
As per my understanding, it seems that only way to create a material is by directly using the material manager GUI. Once the materials are created, it is possible to assign or make it available to groups according to wish via COM

Please correct me if I am wrong.

Ryan:
It is possible to add a new material. To create a new material: 1) Get a reference to an existing material, 2) change the name, and 3) Execute SaveAsNew().

I will add that materials (other than laminates & layups) should be created very carefully according to your design specifications. This only has to be done once.

Materials can be imported from one database to another using File | Import. Click Advanced to import the materials.

The best way to ensure that materials are used consistently throughout an organization is to create a template database. When a new database is created, the template database (and its materials) are copied to the new database. If all team members are using the correct template database (specified in Preferences | Options) you can be sure that the correct materials and allowables are being used.

Related help topics: http://www.hypersizer.com/help/
Software Forms > Database Explorer > Project and Workspace Import Options
Software Forms > Database Explorer > Template Database
Software Forms > Utilities > HyperSizer Options

oseresta:
Thanks.

Another question

After adding a material to group, is it possible to switch the Radio button from "continuous" to "laminate" as per need from COM.

Ryan:
It's located in Group.VariableBound

oGroup.VariableBound(vpdTopFace_ThicknessMaterial, vbdLaminateOnly) = True

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version