[CE][CPP] Visualization Parametric cells 106

Hi folks!

I have a little problem with the visualization (ViewCallback::SetSubstituteElemFunction). I want to highlight a few elements in color based on external data.

E.g. Show all circles belonging to Mr. Smith blue, all circles belonging to Mrs. Johnes green, etc.... No matter what color they actually are.

I think you understand the principle, and why it is handy to be able to have a different representation of the model for a short time.

So and now to my concern:

This works very well in front of all known and named MSElementTypes, but there are also some "unnamed" types like 106 (and 107) better known as parametric cell.

These elements resist penetratingly against assigning a new symbolism with the traditional methods.

What is the easiest method you know to temporarily create a shadow element and recolor it (symbolic) without modifying the original?

Thanks a lot!

Parents
  • I want to highlight a few elements in color based on external data.

    E.g. Show all circles belonging to Mr. Smith blue, all circles belonging to Mrs. Johnes green

    Depending what you mean by 'external data', you might consider the ready-baked Display Rules that are part of MicroStation.  That technology presumably uses ViewCallback::SetSubstituteElemFunction in its implementation.

    We use Display Rules programmatically in our TagWorks products such as AreaAnnotator...

    In this case, the data used to select a Display Rule is taken from an Item Type instance.  I found the DisplayRulesManager API straightforward to use.

     
    Regards, Jon Summers
    LA Solutions

  • Hello Jon,

    Thanks for your suggestion. I had also thought about it before, but I see some issues.

    1. the data analysis can be complex.

    Roughly speaking, I work with a list because I can't do the analysis in c++ during visualization.  I don't know if it's possible to temporarily give the elements a marker that the filter recognizes?
    Or is it possible to create the filter list spontaneously for each visualization?

    ElementId | Color
    124 | 12
    167 | 12
    234 | 23

    2. grouping / nested cells

    For some reason, clients tend to group elements - seemingly quite arbitrarily - and group them again and again...
    Works the Display rule filters on parts inside a cell? So that some parts reacts to one filter and other parts to an other filer?

    thanks a lot.

    Mit freundlichen Grüßen / Best regards
    Volker Hüfner

    |  AB_DATE Engineering  Software   |  ab-date.de  |

  • Parametric cell works in shared mode but it doesn't have an attribute "Override color" like normal shared cell instance does. So it is difficult to change its color after placement. The only way I passed the test was to use level override color, but this could affect the color of all other elements.

    some "unnamed" types like 106 (and 107) better known as parametric cell.

    106 is extended graphic element type and 107 is extended non-graphic element type. All new created elements are 106 type, such as Parametric Solid, Parametric Cell, Point Cloud, Reality Mesh, etc. In C++ we need to use dynamic_cast to determine the real type of an element. For example:

    ParametricCellHandler* pHandler = dynamic_cast<ParametricCellHandler*>(&eh.GetHandler());
    	if (nullptr == pHandler)
    	{
    		mdlDialog_dmsgsPrint(L"Element is not a parametric cell element");
    		return;
    	}



  • Hello

    in U16.2 I found "CONVERT TO SOLID". is there a possibility to convert it to solid and than recolor ist? All I need is a colorful lookalike in the view.

    search for "convert" and  "solid" is to unspecific for fast results.

    Mit freundlichen Grüßen / Best regards
    Volker Hüfner

    |  AB_DATE Engineering  Software   |  ab-date.de  |

  • Some simple smart solids/parametric solids can be converted back to solid, but not all of them. Conversely, all solids can be converted to smart solids.



  • Hello

    Our visualization is intended for analysis, so that the user can observe different states, or print them as PDF. He will usually not continue to construct in this mode.

    1. is there an analogous technique to mdlElemdscr_stroke(), since only the appearance image must be preserved?

    2. is there an example of conveying by solid or other more primitive elements?

    Which option would you recommend?

    Mit freundlichen Grüßen / Best regards
    Volker Hüfner

    |  AB_DATE Engineering  Software   |  ab-date.de  |

  • Dropping element with "Application Elements" options ticked on can help.

    Parametric cell --drop--> Parametric Solids --- drop again---> Smart Solid

    This action can also be implemented by programming as below shown.

    void elementDrop(WCharCP)
    {
    	ElementHandle   eh(2287L, ACTIVEMODEL);
    	if (!eh.IsValid())
    	{
    		mdlDialog_dmsgsPrint(L"Invalid element");
    		return;
    	}
    	ElementAgenda agenda;
    	DropGeometryPtr pDropGeometry = DropGeometry::Create();
    	int options = DropGeometry::Options::OPTION_AppData;
    	pDropGeometry->SetOptions((DropGeometry::Options)options);
    	if (SUCCESS != eh.GetDisplayHandler()->Drop(eh, agenda, *pDropGeometry))
    	{
    		mdlDialog_dmsgsPrint(L"Element Drop failed");
    		return;
    	}
    	for (EditElementHandleR eeh : agenda)
    		eeh.AddToModel();
    }
    



  • yes ist works, but during the visualization i am NOT allowed to modify any element, all modification have to take place in memory. 

    Mit freundlichen Grüßen / Best regards
    Volker Hüfner

    |  AB_DATE Engineering  Software   |  ab-date.de  |

  • Parametric cell --drop--> Parametric Solids --- drop again---> Smart Solid

    Seems to bee a possibility, at least it got me some kind of wire-mesh representation on the screen. Thanks a lot! And I will continue to research.

    Mit freundlichen Grüßen / Best regards
    Volker Hüfner

    |  AB_DATE Engineering  Software   |  ab-date.de  |

Reply Children
No Data