2 Replies Latest reply: Apr 4, 2012 9:06 AM by Ricardo Av-Oracle RSS

    3D VueEntity Set Color and Hide using AutoVue VueBean API

    RichardTroth
      I am developing a Java application using the AutoVue VueBean API for 3D files
      I need the ability to change the colour and hide specified VueEntities

      Can anyone provide advice / VueBean code samples for this requirement.

      Thanks, Richard
        • 1. Re: 3D VueEntity Set Color and Hide using AutoVue VueBean API
          RichardTroth
          I have found out how to set the values:

          Vueentity.getEntityAttributes().setUserAttribute(VueEntityAttributes.ATTRIB_VISIBILITY, m_hide);
          Vueentity.getEntityAttributes().setUserAttribute(VueEntityAttributes.ATTRIB_COLOR, Color.black);
          • 2. Re: 3D VueEntity Set Color and Hide using AutoVue VueBean API
            Ricardo Av-Oracle
            Entity properties are stored inside a 3d VueEntity as attributes and managed through the VueEntityAttributes interface
            The list of out of the box attributes is defined in the interface itself
            The ones you make reference are ATTRIB_VISIBILITY and ATTRIB_COLOR
            they take a Boolean and Color respectively

            Usually, getting a hold of a 3D entity is done through the selection (ie user clicks and selects a body), and it is acheived through the VueBean VueController Vue3DController
            and selector interfaces
            To get a hold on the selected entities you invoke something like
            VueEntity[] ents = vuebean.getController().get3DController().getSelector().get();

            Then modifying the attributes through the attrib interface. Attributes are divided into model and user defined (overidable) attributes.
            In your particular case, you need to modify the overridable attibute, a simple way to access those is
            to get an attibute value
                           VueEntityAttributes vea = entity.getEntityAttributes();
                           Boolean vis = (Boolean)vea.getEffectiveAttribute(VueEntityAttributes.ATTRIB_VISIBILITY);
            to set the value
                                VueEntityAttributes vea = entity.getEntityAttributes();
                                vea.setUserAttribute(VueEntityAttributes.ATTRIB_VISIBILITY, Boolean.TRUE);

            same applies to color

            Cheers