Trying to retrieve face using ComponentInstance.glued_to
-
I'm having some trouble. I'm trying to figure out which direction a window on my house is facing. I have the direction saved as an attribute in the face, rather than a group or component. The trouble seems to be with getting that face. I'm trying to use componentinstance.glued_to, but it's throwing a syntax error.
Here's my snippet:
if entity.typename == "ComponentInstance" cell_data.push(entity.definition.name) if(entity.definition.name == "Window _1") wall = entity.glued_to if(wall.get_attribute("hathmore_attributes", "type") == "AGW" cell_data.push(wall.get_attribute("agw_attributes", "direction_facing")) else cell_data.push('-') end end else cell_data.push('-') end
I feel like the problem is staring at me, I just can't seem to find it.
Thank you in advance for whatever you can do to help.
-
Exactly what does the error say?
-
FYI: There is a missing ) in line 5 of the snippet.
-
@dan rathbun said:
FYI: There is a missing ) in line 5 of the snippet.
D'oh! Thank you! I was so sure I was using this wrong that I didn't even look for actual coding errors.
-
@lothcat said:
@dan rathbun said:
FYI: There is a missing ) in line 5 of the snippet.
D'oh! Thank you! I was so sure I was using this wrong that I didn't even look for actual coding errors.
Usually the Ruby error tells you what line of the code that the error is in, and echos that erroneous line.
Also it may print an extra line beneath the erroneous line with a caret symbol pointing at where it thinks the error is. Not always helpful, as it may just point at the end of the code line if the parser doesn't really know, for instance, where the missing ")" symbol should go.And.. a syntax error IS a coding error, most often missing delimiters, brackets, etc.
Advertisement