Help with Script

I am not sure what I am doing wrong. I am trying to figure out my script. I am not able to upload anything being a new member so that’s a great way to begin, yeah? How do I get you the info you would need to help? Lets begin there.

Welcome to the community. :slight_smile:

Just about to update your trust level a bit so you can post pics and files. Well to some extent anyway. Let me know if things still don’t work and I’ll take another look when I get home for the night.

Maybe write a simple description of the bit that’s not working and what you’re trying to do?

I may have to just word it. I can only add a mx of 8MB to the site and in a blank project with 2 pipes i am a little over 15kb. I am trying to dimension MEP pipes to gridlines. I do not use OOTB Revit parts. Mine are database driven. My company also uses the Victaulic add in if that helps. I downloaded a few scripts and have been modifying to work. I can see the pipes in Dynamo, I can see what appears to be the dimensions. However all I see in the view is blue lines in the view. I am not familiar with Dynamo but in the last few months have learned quite a bit. I have other scripts that work yet this particular script fights the good fight. Attached are the scripts I am working with. I may not be able to upload a sample model unfortunately. I am not able to make a blank project under 15kb. Can only upload 8MB?
I have added screen shots showing what I see on my views before and after, as well as what i see in Dynamo. This will be difficult. I am doing what i can to get the info out.

image

DimensionPipeToClosestGridLines.dyn (127.3 KB)
New Dimension Build.dyn (286.9 KB)

I don’t know what i don’t know and with this I do not know what I am missing to make the script work. I can see I am very close to getting it functional. Some guidance and advice would be wonderful.

Are the dimensions being created, but just not visible in the view?

I feel like they are trying to be created. As I am trying to show in the snips, the dimensions come in as the blue lines. Almost as if they need the second element to connect to? That’s just theory. In the New build script I attempted to add the specific dim style and the results are the same. In the Dynamo snip. I circled the pipes above the grid and the dimension lines below on grid level. So to me, it appears its only really grabbing the grid and not the pipes themselves causing the dimensions to not appear properly. At one point, I didn’t think it was even an option as the pipes are database driven and not Revit OOTB MEP Fabrication Pipework. However seeing that I have made it this far, I feel i can make this work.

I also feel I am not the only company doing this. Maybe in my area but not worldwide. I understand that many are using the OOTB Revit and going with that (Schematic Drawings). When we decided to become a fab shop we went away from the native Revit and got a database. We use Victaulics’ add in, as I’ve mentioned, for converting and procuring, spools…eventually I will write a script to cut time on those tasks but as for now, we are manually adding dimensions to our views. Talk about a waste of time. We have all seen videos of making this work with the OOTB native Revit pipes/ducts. So we should be able to get Dynamo to work with database driven parts. I hope. With some help I feel we can make this work.

Dimensions should show if Dynamo script worked. Dimensions do show if added manually.

Then again, they must know where the pipe centerline is to get even the resemblance of the dimension. So why do they not show on the view properly? I do not see any leader lines to the pipes however. Just odd.

When you run the script, look at the results of the dimension create node (like shown below). If it shows a list of dimensions, then the script is creating the dimensions, but you just can’t see them in the view. If you click on the id of one of the dimensions (highlighted in green), it will probably say that “no good view could be found”. The cause is usually the references you are dimensioning to are not co-planer with the view (which more than likely is the piping references). There are several posts within the forum that talk about this issue. One is link below.

Oh. Thanks. Well back to square one. Sorry I am not able to share a model on this site. Ill figure it out… one day…

There is plenty of examples of being dimensioning pipes and other elements using Dynamo on this forum, start there.

Learning Dynamo is not normally an overnight process, be prepared to completly re-write entire scripts because you realise you took the wrong tack at the very end.

Also, last i checked 15kb is less that 8mb so there should be no issue uploading the example file you want to?

Been working on this one script since September so I understand its not an overnight thing. Since September I have been reading and rewriting this script. 1mb = 1000kb. Site will not allow upload. I have written usable scripts. This one in particular is kicking my ass. Note, there are other forums that I have posted the model and script, Still, I have yet to find anyone that can look at it, give me some feedback and guidance on making it work. I have read so many posts, watched so many videos I am exhausted. I am certified expert in other CAD software’s. Writing macros is nothing. Dynamo is just an entirely different beast of understanding and thinking. I can add tags like BOI/BOP with dynamo. So what am I not doing correctly that this script just refuses to add dimensions?

Exactly, so if your file is 15kb then that is actually 0.015 MB which is less than 8.
There should be no issue here, maybe take a screenshot of the file and its size, the forum admins may be able to advise why such a file is having a problem.

As far as nobody helping, it is likely because you are not providing sufficient information for someone to help with yourt specific problem. (If what you have provided is similar to the above information here)
I can tell you for sure that THIS forum WILL have people that can solve your problem easy, you just need to frame it in a mannor that makes it easy for others to understand.

A small guide for you here;

  1. Create a small sandbox project that captures the scenario.
  2. Create your script and run it.
  3. Post the results here with a screenshot of the dynamo graph (Zoom all the way into one node, and press the camera button)
  4. When taking the screenshot make sure that all the nodes have either a watch node or are expanded in the view so the reviewers can see the data flow through the graph.
  5. Post the resulting screenshot of the dynamo graph, there hopefully should be no need to even post a Revit file, but use it anyway for testing the script because thousands of items can be difficult to see where the error is.

I am requesting it this way because if others are like me, they are currently working on scripts themselves and do not want to close what they are doing to help, rather have an image to review.

If you do not know where the error is, try not looking at the end result, but rather start freezing later parts of the script and see if you are getting the results you are expecting within the information in dynamo.

With regard to your blue lines, That’s just the Revit Background Preview from your current graph. It’s a temporary overlay that will go away after you close the graph. You can also toggle it off or on from the View settings.

I can do that! However the issue is not 15kb…I just noticed i meant 15k kb…I apologize for not stating that correctly and catching it sooner.

I was hoping those lines were the dimension lines not showing properly. Oi vey.

Half my battle is not knowing how to ask or show my problem. This is different language for me right now but I’m getting better. Thank you for showing me how to help you help me. I need that. I will get something posted shortly.

Whatever project template you are using on your sandbox project, purge it to reduce the file size down to something that we can work with on the forums.

  • I’m sure your employer would not enjoy the company templates being spread around the world.

Just copy or create levels at same height, pipes at same height/location and grids around them like your actual model. Wont take you long, and helps people test the script insitu.

Generally a dimension will require two parallel references (not geometry) and a location line in the direction of the dimension string. The Genius Loci package has nodes/code for getting element references which may help if the script is too convoluted in current state.














image





I started with the overall map. Then from the lower left I followed over for Pipe. Then up for grids and how they connect, then the dimensions, and level on top at the end. As I look over this I wonder if I have overdone some nodes in desperation to make this work. I feel I could simplify this…

By zooming all the way into one node and the camera button you can post this whole thing as one image for us to browse.