Cancel
Showing results for 
Search instead for 
Did you mean: 

Function to copy a property

Creator
Creator

Is there a function to copy/modify a property. I want to copy a spring/damper property and modify the axial stiffness value thru an API.

 

The following helps to create a property, but i'm struggling to copy an existing property by selecting an element. Appreciate any kind of help. Thanks

PropID = P.NextEmptyID
P.title = "Caterpillar"
P.type = FET_L_BEAM
P.flagI(1) = 5
P.pval (40) = RAD
P.ComputeShape (False, False, True)
P.matlID = matID
P.Put(PropID)

 

1 REPLY

Re: Function to copy a property

Legend
Legend

Dear Krish,

 

 

To copy property, you need to use Prop Get Method, modify data and Put property with another ID.

Here is small example which copies property with ID = 3 and modifies title and pval(40):

 

Sub Main
    Dim App As femap.model
    Set App = feFemap()

    Dim propIdToCopy As Integer
    propIdToCopy = 3

    Dim beamProp As femap.Prop
    Set beamProp = App.feProp

    'get all data for property ID = 3
    beamProp.Get(propIdToCopy)

'update properties you want
Dim rad As Double
rad = 0.01
beamProp.title = "Caterpillar"
beamProp.pval (40) = rad

'store property with new ID
Dim propId As Integer
propId = beamProp.NextEmptyID
beamProp.Put(propId)

App.feViewRegenerate(0)
End Sub

 

 

Yarko