1130x
003427
2019-08-06

Creazione di spline NURBS tramite interfaccia COM

Come posso creare NURBS utilizzando l'interfaccia COM?


Risposta:

L'oggetto principale non è un oggetto linea, ma un oggetto del tipo NurbSpline.

Hier ein kurzes Beispiel zum Anlegen eines Nurbs Splines:

'--------------------------------------------------------------------------------------------------
Sub nurbs_test()
'--------------------------------------------------------------------------------------------------

    Dim modello Come RFEM5.model
    Set model = GetObject(, "RFEM5.Model")
    model.GetApplication.LockLicense

    On Error GoTo e

    Dim data As IModelData
    Set data = model.GetModelData

    ' define array of nodes
    Dim nodes(0 To 2) As RFEM5.Node
    
    nodes(0).No = 1
    nodes(0).Type = Standard
    nodes(0).CS = Cartesian
    nodes(0).X = 1
    nodes(0).Y = 1
    nodes(0).Z = 0

    nodes(1).No = 2
    nodes(1).Type = Standard
    nodes(1).CS = Cartesian
    nodes(1).X = 2
    nodes(1).Y = 1
    nodes(1).Z = -1
    
    nodes(2).No = 3
    nodes(2).Type = Standard
    nodes(2).CS = Cartesian
    nodes(2).RefObjectNo = 2
    nodes(2).X = 0
    nodes(2).Y = 1
    nodes(2).Z = 0
    
    Dim darr1(0 To 5) As Double
    darr1(0) = 0
    darr1(1) = 0
    darr1(2) = 0
    darr1(3) = 1
    darr1(4) = 1
    darr1(5) = 1
    
    Dim darr2(0 To 2) As Double
    darr2(0) = 1
    darr2(1) = 1
    darr2(2) = 1
    
    Dim ns As NurbSpline
    ns.General.No = 2
    ns.General.Type = NurbSplineType
    ns.General.NodeList = "1,2,3"
    ns.General.Comment = "line 2"
    ns.Knots = darr1
    ns.Order = 3
    ns.Weights = darr2
    
    data.PrepareModification
    data.SetNodes nodes
    data.SetNurbSpline ns
e:  data.FinishModification
    If Err.Number <> 0 Then MsgBox Err.Description, , Err.Source

    Set data = Nothing
    model.GetApplication.UnlockLicense
    Set model = Nothing

End Sub


Autore

Il signor Günthel fornisce supporto tecnico per i clienti di Dlubal Software e si prende cura delle loro richieste.

Download


;