Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document.current always null #3166

Closed
epeter- opened this issue Nov 18, 2014 · 3 comments
Closed

document.current always null #3166

epeter- opened this issue Nov 18, 2014 · 3 comments

Comments

@epeter-
Copy link

epeter- commented Nov 18, 2014

the document.current node always results in null.
daily build 7.4.3192
used as input in "ID to Elements" and "id to Elements"
worked in earlier releases

@ikeough
Copy link
Contributor

ikeough commented Nov 18, 2014

@epeter- Not seeing it in the current daily build.

image

@epeter-
Copy link
Author

epeter- commented Nov 18, 2014

doc

actually the doc is forwarded to the custom node's python code.
so maybe the document's problem is the python?

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

Import DocumentManager

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

Import RevitAPI

clr.AddReference("RevitAPI")
import Autodesk

Import ToDSType(bool) extension method

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

#The inputs to this node will be stored as a list in the IN variable.
dataEnteringNode = IN
#doc = DocumentManager.Instance.CurrentDBDocument
doc = IN[1]
#unwrap incoming information for use with API
ids = []
for i in IN[0]:
ids.append(UnwrapElement(i))
#use element ids to select elements
elements = []
for i in ids:
#check if id is string
if isinstance(i, str) and len(i) <= 7:
idInt = int(i)
elemId = Autodesk.Revit.DB.ElementId(idInt)
elements.append(doc.GetElement(elemId).ToDSType(True))
elif isinstance(i, int):
elemId = Autodesk.Revit.DB.ElementId(i)
elements.append(doc.GetElement(elemId).ToDSType(True))
elif isinstance(i, Autodesk.Revit.DB.ElementId):
elements.append(doc.GetElement(i).ToDSType(True))
elif isinstance(i, str) and len(i) >= 8:
elements.append(doc.GetElement(i).ToDSType(True))
else:
OUT = "invalid input"

#Assign your output to the OUT variable
OUT = elements

@epeter-
Copy link
Author

epeter- commented Nov 19, 2014

Actually i used that workflow in 7.xxx
in daily builds as from 20141115 i am missing
"Document.InternalDocument" node
Am 18.11.2014 13:28, schrieb Ian Keough:

@epeter- https://github.com/epeter- Not seeing it in the current
daily build.

image
https://cloud.githubusercontent.com/assets/1139788/5087249/2a2af0ee-6edb-11e4-9003-40e0280d5187.png


Reply to this email directly or view it on GitHub
#3166 (comment).


Diese E-Mail ist frei von Viren und Malware, denn der avast! Antivirus Schutz ist aktiv.
http://www.avast.com

@epeter- epeter- closed this as completed Nov 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants