How can I hide the content (Show Contents off) of a plane when I zoom out? It is needed when the plane contains a lot of graphics objects.
How can I hide the content (Show Contents off) of a plane when I zoom out? It is needed when the plane contains a lot of graphics objects.
Use the On Draw pick option "Hide Shape and Contents at a Distance":
If you want to only hide the contents and not the shape itself, adjust the code of the pick option accordingly.
You can also use the Frustum Culling checkbox in your screenshot to hide to contents of the visual tool if it is outside the frustum of the view's camera. See Visuals (flexsim.com)
Here's a small improvement/alternative that considers the distance to the actual viewpoint of the frustum rather than the point on the ground on which the view is focussed:
// If this function returns a true, the default draw code of the object will not be executed. Vec3 mgroundviewpoint=Vec3(viewpointx(view).value,viewpointy(view).value,viewpointz(view).value); Vec3 mcurrcentre=current.getLocation(0.5,0.5,0.5).project(current.up,model()); Vec3 groundpath=mgroundviewpoint-mcurrcentre; double azimuth=-1*viewpointrx(view).value; double elevation=Math.radians(azimuth); double viewradius=viewpointradius(view).value; double groundradius=Math.cos(elevation)*viewradius; double z=Math.sin(elevation)*viewradius; double bearing=viewpointrz(view).value-90; double rotation=Math.radians(bearing); double y=Math.sin(rotation)*groundradius; double x=Math.cos(rotation)*groundradius; Vec3 topov=Vec3(x,y,z); Vec3 mpov=mgroundviewpoint+topov; Vec3 path=mpov-mcurrcentre; //print("dist:",path.magnitude,"azimuth",azimuth,"groundRadius",groundradius,"height",z,"bearing",bearing,"x",x,"y",y,"flexdistfromview:",distfromviewpoint(current,view)); if (path.magnitude>20) switch_hidecontents(current,1); else switch_hidecontents(current,0);
It probably still worth have frustum culling enabled with this because you could be very close but looking in the other direction.
14 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 | © Autodesk Inc. All rights reserved