Home
Reply
Regular Contributor
castillor
Posts: 74

Remove color attribute from entity

Hi,

 

Is there a way to remove a color attribute from an entity? Thank you.

 

Regards,

Raymond

Spatial Employee
gweedo
Posts: 14

Re: Remove color attribute from entity

In Scheme you can do this:

     (entity:lose-attribs ent "rgb_color-st-attrib")

 

 

The important part of the CPP code for this is defined in SPAScmExt\kern_scm.m\src\ent_scm.cpp:

 

    ENTITY *pEntity = get_Scm_Entity(argv[0]);

  constchar* pcEntityType = (argc > 1) ? get_Scm_String(argv[1]) : NULL;

   // Translate save name to parameters for the search routine.intent_type = -1, ent_level = -1;

  if(pcEntityType != NULL)

  {

            find_entity_code_and_level(pcEntityType, ent_type, ent_level);

    }

    ENTITY_LIST ents;

    ents.add( pEntity );

  for (inti=0; ; ++i)

  {

         ENTITY* this_ent = ents[i];

     if(this_ent==NULL)

         break;

        this_ent->copy_scan(ents);

    }

    API_BEGIN

    ents.init();

  for(pEntity = ents.next(); pEntity; pEntity = ents.next() )

  {

         if(is_ATTRIB(pEntity))

     {

           if(pcEntityType == NULL || pEntity->identity(ent_level) == ent_type)

         {

                    pEntity->lose();

                }

          }

    }

    API_END