Host reference points on XY plane of reference points

#1

As we know, if we host a reference point on another reference point, these 2 points are “connected”, moving the parent point will also move the other. In Dynamo, I successfully creating reference points on reference points, but the hosted features are gone, Can anyone offer me some assistance by showing me how to get the reference points hosted? Thank you very much!

0 Likes

Reference point driven arc model line using Dynamo
#2

The “unhosted” referfence points on refernce points I created from dynamo.

0 Likes

#3

I don’t think there’s a node for that.
You’d have to code that yourself using a Python node.
Relevant API bits:
http://www.revitapidocs.com/2017/cb090678-50c1-6ecf-5dae-fc3a49cfbb72.htm
http://www.revitapidocs.com/2017/ca9299cc-2931-1a63-cacb-a41f20baf7f1.htm

0 Likes

#4

Dear Andreas_Dieckmann,
I am really grateful for your comments, but I am totally blank to python coding. Could you please further elaborate so as to give me some guidance? Sorry for my ignorance.

Thx!

0 Likes

#5

Hi @pccheung

This should do what you want:

import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import*
clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from Autodesk.Revit.Creation.FamilyItemFactory import NewReferencePoint


doc = DocumentManager.Instance.CurrentDBDocument
app = doc.Application

ref = [UnwrapElement(i).GetCoordinatePlaneReferenceXY() for i in IN[0]]
pts = []

TransactionManager.Instance.EnsureInTransaction(doc)

for r in ref :
	re = app.Create.NewPointOnPlane(r,UV(),UV(),0)
	p = doc.FamilyCreate.NewReferencePoint(re)
	pts.append(p)

TransactionManager.Instance.TransactionTaskDone()

OUT = pts  

First, the hosted points are created. Then the offset can be set as a parameter

3 Likes

#6

HI @Mostafa_El_Ayoubi

This is what I am exactly looking for!!!

This world is beautiful because of your selfless attitude. Tribute to you!

1 Like

#7

@pccheung my pleasure :slight_smile: glad I could help

0 Likes

#8

Hi Mostafa,

Thanks for sharing this!
I have an issue with it… Everytime time dynamo runs it creates a new point. So you end up with multiple coinciding points…
Could you help with fixing that issue?

Thanks again!

0 Likes