可见边是通常在 3ds Max 中不可见的隐藏线。通常,此问题会在 Revit 模型中出现,因为从 Revit 中导出的任何项都是三角形的。这将会导致 3ds Max 通常隐藏的边变得可见。
例如,如果您在 Revit 中拥有仅在 3ds Max 中显示四条边(为墙的四个面)的墙,则您可以识别可见的边。然而,3ds Max 将显示连接两个角顶点的中间三角形。通常,此中间三角形是隐藏起来的。
使用此脚本可隐藏导入模型(特别是使用 FBX 加载到 3ds Max 中的 Revit 2010 版及更早版本的模型)中任何不需要的边。该脚本会读取所有边并通过评估这些边的旁边是否存在任何相邻的边来确定可以隐藏哪些边。隐藏这些不需要的边可使模型更易于查看。
若要使用此脚本,请执行以下操作:
此外,您还可以将此脚本保存在 3ds Max 中,并在选择对象时拖动视口中的 .ms 文件。
( -- do this in a local scope so I don't pollute the global scope. function setVisibilityEdges obj = ( local edgeSelSet = #() -- Go through all faces local numFaces = obj.numfaces for faceIndex = 1 to numFaces do ( -- And for every one of the 3 edges for edgeIndex = 1 to 3 do ( --collect the edge append edgeSelSet ( ((faceIndex-1)*3) + edgeIndex ) ) ) -- Select all visible edges meshop.autoedge obj edgeSelSet 5 type:#setclear ) --============================================== -- Start of the runtime script --============================================== local timestart = timestamp() -- turn off undo during this operation. with undo off ( local editMeshArray = #() for obj in Selection do ( if (classof obj == Editable_Mesh) do ( -- collect all the edit meshes first, because the -- user could have selected some helper objects too, which we -- don't want to process. append editMeshArray obj ) ) -- we don't need to hold the selection anymore, clear it out. clearselection() -- Array of object handles that have already had their edges hidden local allReadyProcessed = #() -- iterate through all selected edit meshes... for editMeshobj in editMeshArray do ( local found = (FindItem allReadyProcessed editMeshobj.handle) > 0 if (not found) then ( setVisibilityEdges editMeshobj append allReadyProcessed editMeshobj.handle -- Mark all the instances as processed too! InstanceMgr.GetInstances editMeshobj &repeatArray if (repeatArray.count > 0) then ( -- mark them as processed by adding their handle to the array for repeat in repeatArray do ( append allReadyProcessed repeat.handle ) ) ) ) ) redrawviews() local timeend = timestamp() format "Total time: % (seconds)\n" ((timeend - timestart)/1000.0))