Can the Dynamo Planes be visualised bigger in Dynamo geometry preview? I see like rectangles but very tiny in the preview, would like to make them bigger. I traced a 300mm side rectangle in each plane but I would consider this unnecessary task.
Hi open mep have a node called plane display or something, probably it could help
something that does not require a dynamo package? I am resolving this temporarily with python code tracing planes but I think this is stupid task should not happen, I mean the dynamo point,line,solid,surface looks correct in preview but I cannot see the planes if I do not zoom in too way much
Rectangle.ByWidthLength has an override which takes a plane which may work.
If you want something you call many times but don’t want to use a package you can leverage a design script definition as follows:
def DisplayPlane(plane: Plane, size: double)
{
rectangle = Rectangle.ByWidthLength(plane, size,size);
surface = Surface.ByPatch(rectangle);
color = Color.ByARGB(100,200,200,200);
display = GeometryColor.ByGeometryColor(surface,color);
return display;
};
Put this in a code block, and then every subsequently placed code block can call the function using DisplayPlane(plane,1000);
to generate the display of a translucent surface at the size you want. If you want more transparency or change the color just update the value in the definition and all displays will follow suit.
I am trying to make it work in ironpython2.7 code within a dynamo node. but I get this error
Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File "<string>", line 216, in <module>
File "<string>", line 75, in DisplayPlane
AttributeError: 'type' object has no attribute 'ByARGB'
Can’t debug code I can’t see. Note that the design script will out perform the Python here by a fair margin (no extra engine and VM to spin up) so not sure why you’re converting.
import clr
clr.AddReference('DSCoreNodes')
from DSCore import Color
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
def DisplayPlane(plane, size):
# Create a rectangle on the plane with the specified size
coordinateSystem = plane # If 'plane' is not directly usable, you might need to extract or convert it to a CoordinateSystem.
rectangle = Rectangle.ByWidthLength(coordinateSystem, size, size) # Adjusted order and usage.
# Create a surface from the rectangle
surface = Surface.ByPatch(rectangle)
# Define a color (using ARGB values)
color = Color.ByARGB(100, 200, 200, 200)
# Apply the color to the surface for display
display = GeometryColor.ByGeometryColor(surface, color)
return display
but error is this now:
Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File "<string>", line 217, in <module>
File "<string>", line 78, in DisplayPlane
NameError: global name 'GeometryColor' is not defined
Try and run it without the definition
it was missing just this clr.AddReference('GeometryColor') from Modifiers import GeometryColor
so this works:
import clr
clr.AddReference('DSCoreNodes')
from DSCore import Color
clr.AddReference('GeometryColor')
from Modifiers import GeometryColor
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
def DisplayPlane(plane, size):
# Create a rectangle on the plane with the specified size
coordinateSystem = plane # If 'plane' is not directly usable, you might need to extract or convert it to a CoordinateSystem.
rectangle = Rectangle.ByWidthLength(coordinateSystem, size, size) # Adjusted order and usage.
# Create a surface from the rectangle
surface = Surface.ByPatch(rectangle)
# Define a color (using ARGB values)
color = Color.ByARGB(100, 200, 200, 200)
# Apply the color to the surface for display
display = GeometryColor.ByGeometryColor(surface, color)
return display
but I tried it an example and some of the planes appear very far away from where I was expecting aligned in the lines displayed, not sure why, I suppose the script creates a rectangle in the origin point of the planes?
Yes - if you want them located somewhere else you’ll need to translate them from the plane origin to the desired location point.