Directshape not working?

Hello, I am using revit 2017 and trying to use direct shape but it is not working. No matter what I do I get error messages. This one is the most common: Warning:
DirectShape.ByGeometry operation failed.
Element id categoryId may not be used as a DirectShape category.
Parameter name: categoryId
What does it mean? How do I get direct shape to work? I am trying to create 3D rooms so I can run an intersection to see which diffuser are in which rooms. Does that make sense?

Instead, could you consider doing it in Dynamo?
Broad steps…

  1. Get the Bounding box/Geometry of the Room Elements
  2. Get the Bounding box/Geometry of the diffusers
  3. Check for intersection

As for the Direct Shape issue, images/files would help

Revit 2017 limits the types of category a DS can belong to. I don’t have a list of all the valid categories tho…

You can’t create 3d room with direct shape any more.
It’s in the limitation list.

It’s really meaningless.

@Enes_Kaan_Karabay Thanks, at least that lets me know that Im not crazy! can you use it in 2016? Is there any other way to get the room as a 3D solid and import it back into revit?
@Vikram_Subbaiah Can you show an example please? Thanks!

Another alternative to Vikram’s solution within Dynamo:

  1. Get the location of the diffusers as a point (using Clockwork’s Element.Location node works for me)
  2. Check if the point is in the room using Room.IsPointInside (also via clockwork)

This method relies on knowing that the location point of the diffuser won’t be above the room, which might be the case if your room stops at the ceiling. You might want to make your rooms level to level first for this to work properly. I’ve done a similar workflow with Spaces instead of Rooms, but should be the same idea.

@Jared_Friedman
How do you tell what the nodes are looking for for inputs? I am getting error messages…

@mix First, you need to get the elements of the family type, and not just the family type. Second, you’ll need to extract the points of the elements and feed that into the points input. I’m not sure whether or not the Room.IsPointInside is setup to accept lists, but there are workarounds for that.

In the meantime see the image below. This will give you the points of your diffusers (You actually can use the native FamilyInstance.Location component here instead of the clockwork one if you want. If you use the clockwork one, you will want to use the ‘points’ output, and not the ‘isPoint’ output.

I seem to still be having difficulty. I am getting a huge list of all the rooms which is fine and returning a true/false in the huge list. How do I just extract the “true” values? Thanks!

Here is the list;

#Valid DirectShape Categories:
[0] Ramps
[1] Cable Tray Fittings
[2] Structural Connections
[3] Planting
[4] Mass
[5] Air Terminals
[6] Communication Devices
[7] Piping Systems
[8] Plumbing Fixtures
[9] Ceilings
[10] Pipe Segments
[11] Conduit Fittings
[12] Sprinklers
[13] Doors
[14] Lighting Devices
[15] Curtain Systems
[16] Parking
[17] Ducts
[18] Conduits
[19] Structural Trusses
[20] Site
[21] Duct Systems
[22] Duct Placeholders
[23] Duct Accessories
[24] Furniture Systems
[25] Lines
[26] Pipes
[27] Topography
[28] Assemblies
[29] Structural Framing
[30] Electrical Fixtures
[31] Data Devices
[32] Lighting Fixtures
[33] Cable Tray Runs
[34] Generic Models
[35] Electrical Equipment
[36] Curtain Panels
[37] Fire Alarm Devices
[38] Roads
[39] Floors
[40] Windows
[41] Rebar Shape
[42] Parts
[43] Columns
[44] Generic Annotations
[45] Curtain Wall Mullions
[46] Walls
[47] Pipe Fittings
[48] Structural Columns
[49] Pipe Placeholders
[50] Structural Rebar Couplers
[51] Cable Trays
[52] Structural Stiffeners
[53] Entourage
[54] Nurse Call Devices
[55] Roofs
[56] Structural Fabric Areas
[57] Structural Rebar
[58] Duct Fittings
[59] Specialty Equipment
[60] Pipe Accessories
[61] Structural Foundations
[62] Security Devices
[63] Railings
[64] Structural Beam Systems
[65] Casework
[66] Mechanical Equipment
[67] Furniture
[68] Stairs

#Not valid
[0] Part Tags
[1] MEP Fabrication Hangers
[2] Pipe Insulation Tags
[3] Analytical Floors
[4] Mechanical Equipment Tags
[5] Foundation Span Direction Symbol
[6] Communication Device Tags
[7] Analytical Wall Tags
[8] Ceiling Tags
[9] Annotation Crop Boundary
[10] Analytical Wall Foundations
[11] Furniture Tags
[12] Pipe Accessory Tags
[13] Security Device Tags
[14] Window Tags
[15] Stair Tread/Riser Numbers
[16] MEP Fabrication Ductwork Tags
[17] Panel Schedule Graphics
[18] Detail Item Tags
[19] Reference Lines
[20] MEP Fabrication Containment
[21] Analytical Spaces
[22] Structural Framing Tags
[23] Section Boxes
[24] MEP Fabrication Ductwork
[25] Elevation Marks
[26] Data Device Tags
[27] Crop Boundaries
[28] Lighting Fixture Tags
[29] Assembly Tags
[30] Duct Tags
[31] Structural Rebar Tags
[32] Door Tags
[33] Internal Area Load Tags
[34] Revision Clouds
[35] MEP Fabrication Hanger Tags
[36] Imports in Families
[37] Multi-Category Tags
[38] Analytical Isolated Foundations
[39] Flex Pipes
[40] Property Line Segment Tags
[41] Curtain Panel Tags
[42] Analytical Links
[43] HVAC Zones
[44] Mass Floor Tags
[45] Electrical Spare/Space Circuits
[46] Analytical Columns
[47] Zone Tags
[48] Reference Planes
[49] Cable Tray Tags
[50] Multi-Rebar Annotations
[51] Matchline
[52] Specialty Equipment Tags
[53] Duct Fitting Tags
[54] Furniture System Tags
[55] Callout Heads
[56] Telephone Devices
[57] Wires
[58] Structural Stiffener Tags
[59] Casework Tags
[60] Project Information
[61] Wall Tags
[62] Cable Tray Fitting Tags
[63] Structural Internal Loads
[64] Electrical Circuits
[65] Analysis Display Style
[66] Pipe Insulations
[67] Flex Ducts
[68] Duct Insulation Tags
[69] Rebar Cover References
[70] Structural Load Cases
[71] Stair Support Tags
[72] Structural Area Reinforcement
[73] Structural Truss Tags
[74] Analytical Slab Foundation Tags
[75] Plan Region
[76] Air Terminal Tags
[77] Structural Annotations
[78] Duct Insulations
[79] Span Direction Symbol
[80] Section Line
[81] Section Marks
[82] Pipe Color Fill
[83] Lighting Device Tags
[84] Floor Tags
[85] Sprinkler Tags
[86] Analysis Results
[87] Scope Boxes
[88] Line Load Tags
[89] Render Regions
[90] Structural Path Reinforcement Symbols
[91] Stair Landing Tags
[92] MEP Fabrication Containment Tags
[93] Analytical Braces
[94] Displacement Path
[95] Duct Lining Tags
[96] Flex Duct Tags
[97] Point Clouds
[98] Analytical Wall Foundation Tags
[99] Analytical Foundation Slabs
[100] Structural Area Reinforcement Tags
[101] Structural Path Reinforcement
[102] Stair Run Tags
[103] Nurse Call Device Tags
[104] Area Load Tags
[105] Routing Preferences
[106] Area Tags
[107] View Reference
[108] Filled region
[109] Analytical Column Tags
[110] Structural Fabric Reinforcement
[111] Connection Symbols
[112] Conduit Fitting Tags
[113] Raster Images
[114] Structural Column Tags
[115] Analytical Beam Tags
[116] Adaptive Points
[117] Grid Heads
[118] Sections
[119] Room Tags
[120] Stair Tags
[121] Structural Loads
[122] Revision Cloud Tags
[123] Conduit Runs
[124] Duct Accessory Tags
[125] Spot Slopes
[126] Keynote Tags
[127] Space Tags
[128] Rebar Set Toggle
[129] Pipe Color Fill Legends
[130] Guide Grid
[131] Grids
[132] Fire Alarm Device Tags
[133] Planting Tags
[134] Callouts
[135] Schedule Graphics
[136] Electrical Fixture Tags
[137] Telephone Device Tags
[138] Curtain System Tags
[139] MEP Fabrication Pipework
[140] Internal Line Load Tags
[141] Structural Fabric Reinforcement Symbols
[142] Mass Tags
[143] Analytical Node Tags
[144] Property Tags
[145] Structural Path Reinforcement Tags
[146] Callout Boundary
[147] Structural Area Reinforcement Symbols
[148] Contour Labels
[149] Areas
[150] Materials
[151] Reference Points
[152] Shaft Openings
[153] Spot Elevation Symbols
[154] Internal Point Load Tags
[155] Analytical Isolated Foundation Tags
[156] Flex Pipe Tags
[157] Cameras
[158] Elevations
[159] Analytical Floor Tags
[160] Structural Connection Tags
[161] Masking Region
[162] Structural Rebar Coupler Tags
[163] Level Heads
[164] Duct Color Fill Legends
[165] Analytical Beams
[166] Curtain Grids
[167] Levels
[168] Brace in Plan View Symbols
[169] Railing Tags
[170] Structural Foundation Tags
[171] Wire Tags
[172] Site Tags
[173] Pipe Tags
[174] Analytical Link Tags
[175] Spot Coordinates
[176] Viewports
[177] Title Blocks
[178] Plumbing Fixture Tags
[179] Pipe Fitting Tags
[180] Duct Color Fill
[181] Stair Paths
[182] MEP Fabrication Pipework Tags
[183] Duct Linings
[184] Roof Tags
[185] Views
[186] Sheets
[187] Conduit Tags
[188] Point Load Tags
[189] Analytical Surfaces
[190] Structural Fabric Reinforcement Tags
[191] Material Tags
[192] View Titles
[193] Parking Tags
[194] Structural Beam System Tags
[195] Analytical Brace Tags
[196] Electrical Equipment Tags
[197] Generic Model Tags
[198] Switch System
[199] Rooms
[200] Analytical Walls
[201] Text Notes
[202] Detail Items
[203] Spot Elevations
[204] Analytical Nodes
[205] Boundary Conditions
[206] Color Fill Legends
[207] Spaces
[208] Dimensions

4 Likes

Hi, actually I had directshape working in revit 2015 with room categories when I switched from revit 2017. Then, for some reason today, while working with the same script, it suddenly stopped working for me?? Which is creepy. Is there some kind of behind the scenes updating that snached away my nice…WORKING… DirectShape node? Im what the heck??

It’s an “improvement” in 2017 API:

DirectShape API changes
Functions that treat application id and application data id as mandatory GUIDs are being phased out.

This affects:

DirectShape.SetGUIDs()
DirectShape.CreateElement()
DirectShape.CreateElementInstance()
The DirectShape.ApplicationId and DirectShape.ApplicationDataId properties should be used instead.

DirectShape.IsValidCategoryId() has been reimplemented. The new version lists categories approved for use with DirectShape. The old version listed all top-level built-in model categories.

I think I understand that, but that doesnt explain why Direct Shape wouldnt work for room categories in Revit 2015. Nor does it explain, why, it was working before lunch and then somehow decided to stop working after lunch…unless I missed something of course…

okay, I misunderstood you…

@mix If what you are doing is trying to return a room for each diffuser you can have a python node such as below (input 0 is your rooms, input 1 is your point locations for the diffusers). Note that this is fairly rough and is adapted from something that I’ve done with Spaces, so it’s not perfect code, but I think it’s along the lines of what you are going for. It will return a null if you have a diffuser that doesn’t fall within a room.

@Jared_Friedman Thanks, but ive never done python script and Im a greenhorn at best with C#. Isnt there a way to do it with dynamo nodes? Im not sure I will be able to use this…