before deployment I wanted to make sure that the script works on our test projects.
My script was working perfectly fine yesterday, nothing changed. (I only copied the script to a different location).
However, when I ran it today, the color override doesn’t do it’s job anymore and I even get an error.
What might have caused this? I’m truly baffled what happened.
DirectShape.ByGeometry,1,“DirectShape.ByGeometry operation failed. The referenced object is not valid, possibly because it has been deleted from the database, or its creation was undone.”,null
Element.OverrideInView,1,“Internal error, please report: Dereferencing a non-pointer. href=DereferencingNonPointer.html”,null
The thing is I only get it when I run the thing in the Player. If I open the script and run it form there, there’s a 50/50 chance it will show what I want.
There aren’t any graphical overrides or view templates used. I’m just baffled what the issue is.
Importinstance.ByGeometry seems to work without issue (also in Player), but I’m still suspicious. Does DirectShape have some specific property which interferes somehow with the override?
Not element binding as no bindings are saved in the file. From what I can see the 75% transparency is causing the issue, as you’ve already got a transparency on the object style. This is my test in Revit 2024 and the V1 graph:
Select the element in Revit and look at the manual override, if it’s there then the graph is working. Try to reduce it to 0 and see if it shows up. From my testing a value of 10% makes it effectively invisible.
In unrelated news, you may to consider assigning a ‘needs clearance review’ on items which are inside the clearances; much more efficient on the end users and allows you to help transition them to seeing the potential of data driven design.
Also you may want to review what happens at the corners of your offset - not sure I know many building clearances which allow discarding such areas entirely.
My next step is, to color them in differently if there’s a collision between them. (But something with my lacing is wrong, it only recognizes the first two colliding instances)
I’m in the EU, this specific clearance zone is defined by the facade area, therefore the corners are not a point of interest in this case :).
Which Revit version are you in? Can you show how the graph runs in a clean file from no template, similar to what I produced? If you select the direct shape and check the overrides, is anything there?
Set transparency to 0 as in my example and try again, I think you’ll get results that way. The default for the category or object type (direct shape) you’re using displays the object transparent; you’re making it further transparent which is causing it to become 100% very quickly.