Hi @Thillai, was Joerg Vogel's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.
If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.
Here's an example code that draws a rectangle around an object when placed in its On Draw trigger. The last the parameters in the drawrectangle() command are the RGB color values (0-255). The values in the code below produce a golden-ish yellow similar to your picture.
- fglDisable(GL_LIGHTING);
- drawtomodelscale(current);
- double distFromEdge = 0.5;
- double width = 0.1;
- // Upper edge
- drawrectangle(-distFromEdge - width, distFromEdge + width, 0, current.size.x + 2*(distFromEdge + width), width, 0, 0, 0, 245, 220, 15);
- // Left edge
- drawrectangle(-distFromEdge, distFromEdge + width, 0, current.size.y + 2*(distFromEdge + width), width, 0, 0, -90, 245, 220, 15);
- // Lower edge
- drawrectangle(-distFromEdge - width, -current.size.y - distFromEdge, 0, current.size.x + 2*(distFromEdge + width), width, 0, 0, 0, 245, 220, 15);
- // Right edge
- drawrectangle(current.size.x + distFromEdge + width, distFromEdge + width, 0, current.size.y + 2*(distFromEdge + width), width, 0, 0, -90, 245, 220, 15);
- fglEnable(GL_LIGHTING);
15 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © 2025 Autodesk Inc. All rights reserved