Spot coordinates

Hi
I want to create a script where spot coordinates are created all the structural columns in a view automatically. The script I tried is not working. Nothing is happening. Can someone point out what I am doing wrong?
01-11-2018%201059

I don’t think annotation tag works for spot elevations.
Clockwork package has a node called SpotElevation ByPoint. You should try that.

Hi. But that is spot elevations. What I am looking for is spot coordinates.

Ah sorry, I misread. But you can actually edit the clockwork node SpotElevation ByPoint, open the python, and at line 33, change
doc.Create.NewSpotElevation
to
doc.Create.NewSpotCoordinate
and then save as a new node. They take the same inputs so it should behave the same.

Maybe @Andreas_Dieckmann can make a SpotCoordinate node in addition to his SpotElevation?

2 Likes

Hey Thanks. That is simple enough.:grinning:. I did the changes and saved it as new custom node. Now how do i insert in diagram? It is not showing anywhere?

1 Like

@kennyb6 Sure, will add it to next Clockwork version.

3 Likes

@kennyb6 Tried doing it but nothing happening. Obviously I am not doing something correctly. Can you check and guide?Auto dimensioning of columns.dyn (9.4 KB)

@Kulkul
Could you look in to this by any chance?

Maybe like this? Worked for me.

import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.GeometryConversion)

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

v = UnwrapElement(IN[2])
r = UnwrapElement(IN[0])
p = UnwrapElement(IN[1]).ToXyz()
o = UnwrapElement(IN[3]).ToXyz()
n = UnwrapElement(IN[4]).ToXyz()

TransactionManager.Instance.EnsureInTransaction(doc)

e = []

e.append(doc.Create.NewSpotCoordinate(v, FamilyInstance.GetReferenceByName(r,"Center (Left/Right)"), p, o, n, p, True))

TransactionManager.Instance.TransactionTaskDone()

OUT = e
3 Likes

To use it on multiple elements just wrap it in een custom node and set input to var (singular input) and manage your input lists outside the node. So 1 view, 1 element, 1 point etc. Alternatively mange it in the python self but then you have to provide specific input for the node to work. Which means that you need to manage your input outside the node what you would do anyway so why bother with complex solutions in python?

2 Likes

Where do you get Bend and End Point from?

Those are renamed Point.Add nodes
pointAdd

Yes thanks I just realized that. Still cant get the damn script to work though. Trying to Spot Elevation pipes

Is there any script to take out spot coordinates (YXZ) schedule using dynamo?

Im trying to tag in a 3D view my Survey point, following this code:

svp = BasePoint.GetSurveyPoint(doc)
			
survey_point_inch = XYZ(
		svp.get_Parameter(BuiltInParameter.BASEPOINT_EASTWEST_PARAM).AsDouble(),
		svp.get_Parameter(BuiltInParameter.BASEPOINT_NORTHSOUTH_PARAM).AsDouble(),
		svp.get_Parameter(BuiltInParameter.BASEPOINT_ELEVATION_PARAM).AsDouble()
		)

								
view = doc.ActiveView
point = survey_point_inch
element = svp

def Create_SpotCoordinate_Tag(view, reference, XYZ_origin):
	view = view
	reference = Reference(reference)
	XYZ_origin = XYZ_origin
	XYZ_bend = XYZ(XYZ_origin.X + 1, XYZ_origin.Y + 1, XYZ_origin.Z)
	XYZ_end =  XYZ(XYZ_bend.X + 2, XYZ_bend.Y, XYZ_origin.Z)
	XYZ_refPt = XYZ_origin
	hasLeader_bool = True
	
	spot_coordinate = doc.Create.NewSpotCoordinate(view, reference, XYZ_origin, XYZ_bend, XYZ_end, XYZ_refPt, hasLeader_bool)
	return spot_coordinate

OUT = Create_SpotCoordinate_Tag(view, element, point)

But im not willing to create that SpotCoordinate. Any help with it?