Grasshopper

algorithmic modeling for Rhino

Problem with Implements IGH_PreviewData and Implements IGH_PreviewObject

Hi guys,

Have stacked with the problem of preview/drawing methods.

I am defining a custom Type using following class definition:

Public Class BlockObj

...

End Class

Public Class BlockObjGoo
     Inherits GH_GeometricGoo(Of BlockObj)
    Implements IGH_PreviewData

...

End Class

Public Class BlockObjParameter
    
        Inherits GH_PersistentGeometryParam(Of BlockObjGoo)
        Implements IGH_PreviewObject

...

End Class

In BlockObjGoo I have included following methods and properties:

-ClippingBox;

-DrawViewportMeshes;

-DrawViewportWires;

In BlockObjParameter:

- ClippingBox;

-DrawViewportMeshes;

- DrawViewportWires;

- Hidden;

- IsPreviewCapable.

However when compiling I have the following messages:

Error BC30154: Class 'BlockObjGoo' must implement 'ReadOnly Property ClippingBox As Rhino.Geometry.BoundingBox' for interface 'Grasshopper.Kernel.IGH_PreviewData'. Implementing property must have matching 'ReadOnly' or 'WriteOnly' specifiers

Error BC30149: Class 'BlockObjGoo' must implement 'Sub DrawViewportMeshes(args As GH_PreviewMeshArgs)' for interface 'Grasshopper.Kernel.IGH_PreviewData'.

Error BC30149: Class 'BlockObjGoo' must implement 'Sub DrawViewportWires(args As GH_PreviewWireArgs)' for interface 'Grasshopper.Kernel.IGH_PreviewData'.

Error BC30154: Class 'BlockObjParameter' must implement 'Property Hidden As Boolean' for interface 'Grasshopper.Kernel.IGH_PreviewObject'. Implementing property must have matching 'ReadOnly' or 'WriteOnly' specifiers.

Error BC30154: Class 'BlockObjParameter' must implement 'ReadOnly Property ClippingBox As Rhino.Geometry.BoundingBox' for interface 'Grasshopper.Kernel.IGH_PreviewObject'. Implementing property must have matching 'ReadOnly' or 'WriteOnly' specifiers.

Error BC30154: Class 'BlockObjParameter' must implement 'ReadOnly Property IsPreviewCapable As Boolean' for interface 'Grasshopper.Kernel.IGH_PreviewObject'. Implementing property must have matching 'ReadOnly' or 'WriteOnly' specifiers.

Error BC30149: Class 'BlockObjParameter' must implement 'Sub DrawViewportMeshes(args As IGH_PreviewArgs)' for interface 'Grasshopper.Kernel.IGH_PreviewObject'.

Error BC30149: Class 'BlockObjParameter' must implement 'Sub DrawViewportWires(args As IGH_PreviewArgs)' for interface 'Grasshopper.Kernel.IGH_PreviewObject'.

What is wrong? Why it is saying it should be included despite it is already there?

Any hint?

Thanks,
Dmitriy

Views: 620

Replies to This Discussion

You have to include them in the right format. The methods must have the same name, the same qualifier (protected, public etc.), the same type (ReadOnly, WriteOnly or neither), the same signatures and the same return type.

Visual Studio will automatically create the correct signatures if you let it. How did you create your methods and properties?

--

David Rutten

david@mcneel.com

Tirol, Austria

Hi David,

 

thanks for reply.

I obviously understand that qualifiers and types should be the same and they are the same.

Below is the definition of the IGH_PreviewData:

 

        Public ReadOnly Property ClippingBox() As BoundingBox
            Get
                Return Boundingbox
            End Get
        End Property

        Public Sub DrawViewportMeshes(args As GH_PreviewMeshArgs)
            'No meshes are drawn.   
        End Sub
'        
    Public Sub DrawViewportWires(args As GH_PreviewWireArgs)
        If Value Is Nothing Then
                Return
        End If

        ...

   End Sub

This code has been copied from one of the examples. I am not using Visual Studio but SharpDevelop.

What should I try now?

Thanks,

Dmitriy

 

Have found that following way should work:

Public ReadOnly Property ClippingBox() As BoundingBox Implements IGH_PreviewData.ClippingBox
            Get
                Return Boundingbox
            End Get
End Property

Kind regards,

Dmitriy

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service