Get component Behaviours – [SOLVED]

Forum Forums Visual Components 4.0 .NET Addon Programming Get component Behaviours – [SOLVED]

This topic contains 4 replies, has 2 voices, and was last updated by Avatar Andreluizfc 3 months, 2 weeks ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #11976
    Avatar
    Andreluizfc
    Participant

    Hi,

    I trying to get components inside a layout with valid connections in I/O ports.
    I can get components by using the following script

    And get the behaviors that are connections with

    Each behavior has a field called “IsConnected”. In the debug mode inside Visual Studio I can get the status of this field using the call:

    and it returns me a Boolean.

    But if I try to use that call in the code, the compiler does not recognize “Revolution” class. What should I import to get the “IsConnected” field? Is there any way to get this field?

    EDIT:

    I could not link the Revolution.dll to the project references. It says to check if the file is accessible, or if it’s a valid assembly or a COM component.

    Thanks for the assistance.

    #11989
    TSy
    TSy
    Participant

    Just cast you IBehavior to ISimInterface instead, it has that IsConnected property.
    The wrapper classes are internal, you should only use the interfaces defined in Create3D.Shared.

    #12018
    Avatar
    Andreluizfc
    Participant

    Dear, TSy,

    I tried

    but got the following exception:

    Unhandled exception occurred:System.InvalidCastException: Unable to cast object of type ‘VisualComponents.Revolution.OneWayPathWrapper’ to type ‘VisualComponents.Create3D.ISimInterface’.

    Whays may be wrong?

    #12020
    TSy
    TSy
    Participant

    Not every behavior is an “interface” behavior so you can’t cast all of them to ISimInterface.

    This is pretty basic C# stuff you can easily learn from online tutorials. VC .NET API reference you can find from the help tab of the software.

    #12028
    Avatar
    Andreluizfc
    Participant

    Many thanks, TSy, that solved the problem. I appreciate your prompt reply and clarifications!

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.