Reference Plane host Elevation From Level Problem

Hi,
Sorry for bad english. (google translate)
I have a problem with placing family with Dynamo in Revit.
When I place a family with Dynamo the Reference plane parameter is locked of the revit element.
Elevation From Level should be 2750.0, but appears to be 0.0.
how can I solve this?

ꟿ FamilyInstance.ByHostAndPoint code:

import clr

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument

clr.AddReference("RevitAPI")
import Autodesk

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

def tolist(obj1):
	if hasattr(obj1,"__iter__"): return obj1
	else: return [obj1]

host = UnwrapElement(tolist(IN[0]))
ftype = UnwrapElement(tolist(IN[1]))
fpts = UnwrapElement(tolist(IN[2]))

OUT = []
strt = Autodesk.Revit.DB.Structure.StructuralType.NonStructural
ftp_len = len(ftype) == 1
hst_len = len(host) == 1

TransactionManager.Instance.EnsureInTransaction(doc)
for i in xrange(len(fpts) ):
	p = fpts[i].ToXyz(True)
	j = 0 if ftp_len else i
	k = 0 if hst_len else i
	try:
		if not ftype[j].IsActive : ftype[j].Activate()
		level = doc.GetElement(host[k].LevelId)
		nf = doc.Create.NewFamilyInstance(p,ftype[j],host[k],level,strt)
		OUT.append(nf.ToDSType(False))
	except:
		OUT.append(None)
TransactionManager.Instance.TransactionTaskDone()
1 Like

Does anyone have a different solution suggestion on this issue?

Hello @arthassss

try to use this method
https://www.revitapidocs.com/2021.1/be4b822c-829a-7e7b-8c03-a3a324bfb75b.htm

or this node
image

2 Likes

Hi,
Unfortunately, I do not have enough information to execute the codes in the link you sent.

I also get an error with the node as below.

@arthassss
you need a Reference instead of the ReferencePlane
implement this in your 1st Python Script
https://www.revitapidocs.com/2021.1/825a593b-4acc-c2ad-9df7-b281a3a2575b.htm

1 Like

Use the Element Reference node to obtain a reference (Autodesk.DB.Reference) from the Reference plane.

2 Likes

Hello @c.poupin

Frankly, I’m new to dynamo and I know very little about python.
I have no idea where exactly to add the code you mentioned.
Is it possible for you to send the entire code?

Hi @Alban_de_Chasteigner

problem solved.
Thank you for your interest.

1 Like