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

Problems with placing family instance of Windows or Doors #2197

Open
ColinDayOrg opened this issue Oct 12, 2018 · 5 comments
Open

Problems with placing family instance of Windows or Doors #2197

ColinDayOrg opened this issue Oct 12, 2018 · 5 comments

Comments

@ColinDayOrg
Copy link
Contributor

Issue by michaelbergin
Friday Feb 14, 2014 at 22:48 GMT
Originally opened as DynamoDS/Dynamo#1120


Creating a curve-based model, using Wall by Curve to create some walls.
Evaluating those curves to produce an XYZ where I would like to place windows or doors.

Receiving an error with various attempts to make it so :
Family symbol is not valid for this instance. Parameter name: value

Tried moving the point in the Z axis, using Create Family and Create Family by Level, Changing the levels and elevations of levels, rebuilding the entire script...

image

Version - 0.6.3.22045
https://www.dropbox.com/s/rpojkyrpgkixm5l/dynamo-Outline.dyn

@ColinDayOrg
Copy link
Contributor Author

Comment by mjkkirschner
Saturday Feb 15, 2014 at 02:01 GMT


I'm not 100% on this, but I believe you can't create windows without being associated with a wall to place them in, and I don't think there are any built in nodes that deal with window placement, I wrote a python node that will do it a while ago, I can post it on the package manager soon, but I would search there first to see if someone else has posted a window node.
Does creating some other random family at those xyz works?

@ColinDayOrg
Copy link
Contributor Author

Comment by michaelbergin
Saturday Feb 15, 2014 at 02:55 GMT


Its the general family instance creation node, generic elements are inserted without problem but windows and doors do not work. There is a wall to place them in at the position indicated. I have checked the package manager and nothing obvious that addresses my issue appears.

On Feb 14, 2014, at 6:01 PM, holyjewsus notifications@github.com wrote:

I'm not 100% on this, but I believe you can't create windows without being associated with a wall to place them in, and I don't think there are any built in nodes that deal with window placement, I wrote a python node that will do it a while ago, I can post it on the package manager soon, but I would search there first to see if someone else has posted a window node.


Reply to this email directly or view it on GitHub.

@ColinDayOrg
Copy link
Contributor Author

Comment by mjkkirschner
Saturday Feb 15, 2014 at 20:23 GMT


I am having trouble finding the dyn file, but this might help get you started, you need to supply a window family instance, a list of walls, and the revit document node to a python with variable input nodes.

Python code below

import clr
clr.AddReference('RevitAPI')
clr.AddReference('RevitAPIUI')
from Autodesk.Revit.DB import *
import Autodesk
import sys
import clr
path = r'C:\Autodesk\Dynamo\Core'
exec_path = r'C:\Autodesk\Dynamo\Core\dll'
sys.path.append(path)
sys.path.append(exec_path)
clr.AddReference('LibGNet')
from Autodesk.LibG import *

#The input to this node will be stored in the IN0...INX variable(s).
wall = IN0[0]
windowfamily = IN1
doc = IN2
centerToLeft = 50
bottomToBottom = 5

locCurve = wall.Location

start = locCurve.Curve.get_EndPoint(0)
direction = locCurve.Curve.get_EndPoint(1) - start
location = start + direction.Normalize() * centerToLeft

famInst = doc.Create.NewFamilyInstance(location, windowfamily, wall, wall.Level, Autodesk.Revit.DB.Structure.StructuralType.NonStructural);
famInst.get_Parameter("Sill Height").Set(bottomToBottom);

#Assign your output to the OUT variable
OUT = famInst

@ColinDayOrg
Copy link
Contributor Author

Comment by michaelbergin
Friday May 02, 2014 at 17:43 GMT


Finally getting back around to this - thanks very much for the assistance. Noting that this does not remove the window for parametric alterations, Mohammad Asl and I made these modifications.

# Default imports
import clr
clr.AddReference('RevitAPI')
clr.AddReference('RevitAPIUI')
from Autodesk.Revit.DB import *
import Autodesk
import sys
import clr
path = r'C:\Autodesk\Dynamo\Core'
exec_path = r'C:\Autodesk\Dynamo\Core\dll'
sys.path.append(path)
sys.path.append(exec_path)
clr.AddReference('LibGNet')
from Autodesk.LibG import *

#The input to this node will be stored in the IN0...INX variable(s).
wall = IN0[0]
windowfamily = IN1
doc = IN2
uParam = 0.5
bottomToBottom = 3

locCurve = wall.Location
wallLength =  locCurve.Curve.Length

start = locCurve.Curve.get_EndPoint(0)
direction = locCurve.Curve.get_EndPoint(1) - start

location = start + direction.Normalize() * wallLength * uParam

#deletes the existing windows on the wall
elList = wall.FindInserts(True, False, False, False)
for elemId in elList:
    doc.Delete(elemId)

famInst = doc.Create.NewFamilyInstance(location, windowfamily, wall, wall.Level, Autodesk.Revit.DB.Structure.StructuralType.NonStructural);
famInst.get_Parameter("Sill Height").Set(bottomToBottom);

#Assign your output to the OUT variable
OUT = famInst

Still working on a more elegant solution for placing multiple windows and controlling them independently.

@ColinDayOrg
Copy link
Contributor Author

Comment by jhubers
Thursday Mar 03, 2016 at 08:35 GMT


Why is there not a solution without scripting to place doors and windows in a wall? Seems to me that this is one of the first things a novice with Dynamo would like to do... In fact one of my students wanted to make a terrace wall with many holes. Dynamo seemed the right tool. But finally had to use the array tool of Revit and do the arithmetic by hand. A missed chance to introduce some students to Dynamo.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant