Grasshopper

algorithmic modeling for Rhino

How can I make the Duplicated Geometry displayed in custom component?

I created a custom component as below.

But the out Geometry is not displayed though It can be used by other component.

How can I make the Duplicated Geometry displayed in custom component?

Regards,

Youngfe

 

Public Class xMoveComponent
Inherits GH_Component
Public Sub New()
MyBase.New("xMove", "xMove", "Ciico Move Component", "Ciico", "Transform")
End Sub


Public Overrides ReadOnly Property ComponentGuid() As System.Guid
Get
Return New Guid("0283FFCE-FB68-489d-9650-08E39CABD859")
End Get
End Property


Protected Overrides Sub RegisterInputParams(ByVal pManager As Grasshopper.Kernel.GH_Component.GH_InputParamManager)
pManager.Register_GeometryParam("InGeometry", "G", "Base Geometry")
pManager.Register_CurveParam("PolyLine", "C", "Translate PolyLine")
End Sub


Protected Overrides Sub RegisterOutputParams(ByVal pManager As Grasshopper.Kernel.GH_Component.GH_OutputParamManager)
pManager.Register_GeometryParam("OutGeometry", "G", "Translated Geometry")
End Sub


Protected Overrides Sub SolveInstance(ByVal DA As Grasshopper.Kernel.IGH_DataAccess)
Dim g As GeometryBase = Nothing
Dim crv As Curve = Nothing
DA.GetData(0, g)
DA.GetData(1, crv)
Dim out = g.Duplicate
out.Translate(crv.PointAtEnd - crv.PointAtStart)
DA.SetData(0, out)
End Sub


End Class

Views: 293

Replies to This Discussion

Hi Lawrence,

 

see my response to Rafa's post. The immediate and long-term solution is to use IGH_GeometricGoo, not GeometryBase.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service