.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Sprinkler Pipe Sizing with c# autocad

16 REPLIES 16
Reply
Message 1 of 17
mekanikproje
1632 Views, 16 Replies

Sprinkler Pipe Sizing with c# autocad

"I have a design drawn with Autocad using blocks and polylines. I want to distribute the design starting from three points to the end, and according to a table, I want it to dimension the number of blocks based on their quantity using C#."

 

mekanikproje_1-1712361493247.png

Example

 

mekanikproje_2-1712361866634.png

I want

 

instead of text
atribute
the block is preferable.

 

mekanikproje_3-1712361950088.png

the video is a sample study video shared on the internet, like this one

 

 

 

 

a subject that will be very useful in engineering. i have thrown visual supporting content to understand the subject. i am open to any kind of offer, paid or free. i need c# to do this job in autocad. thank you for your help, dear colleagues.

Labels (1)
16 REPLIES 16
Message 2 of 17
JamesMaeding
in reply to: mekanikproje

@mekanikproje 

You are essentially building a linear tree (no loops), and wanting sizes for the branches based on counts of sprinklers "beyond" them, starting at the trunk. Is that correct?

Such structures are easily represented in C# using objects where each object is a line, and a list of objects branching off it at its other end. Each branch also has a "sprinkler at end" property that is yes/no.

It is assumed the end of branch segment may or may not have a sprinkler, but sprinklers always "break" segments.

Its typical water modeling skeleton structure.

So a branch may have 3 or 4 branches coming off it at its end, and you will make functions that count sprinklers past a given object to get its size from the table.

That is once you have the tree built from selecting the lines and blocks in the dwg.

Now, connecting the lines and blocks is another task. You can get away with brute force on 1000 lines or less. Beyond that, you likley need to change to computational geometry methods where you sort things to eliminate a lot of tests that will fail.

This is a good 20 to 40 hour task for someone decent at C#. What are your resources and what will you use this for?

A few thousand paid once but used for years will be a good deal given our $20/hr new minimum wage 🙂

thx

 


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

Message 3 of 17
mekanikproje
in reply to: mekanikproje

"You are essentially building a linear tree (no loops), and wanting sizes for the branches based on counts of sprinklers "beyond" them, starting at the trunk. Is that correct?"

yes.

the wage request is not exaggerated. but it is good that it is suitable for me. inflation and the dollar are very high in turkey. 1 usd = 32 tl :).
inflation = %80

 

Message 4 of 17
kdub_nz
in reply to: mekanikproje

 

@mekanikproje 

For reference,  do you have a link to the video ?

 

Regards,

 

 


// Called Kerry in my other life.

Everything will work just as you expect it to, unless your expectations are incorrect.

class keyThumper<T> : Lazy<T>;      another  Swamper

Message 5 of 17
mekanikproje
in reply to: kdub_nz

Message 6 of 17
timgrote
in reply to: mekanikproje

@mekanikproje 

I've got something like this written already, and with the ability to solve for max pressure drop as well as velocity. I've been thinking about marketing it for fire sprinklers as well as landscape. DM me if interested.

 

https://www.loom.com/share/a0282fb3cf54452f95d4be2e0d611617?sid=ec5fd43d-0898-4b47-859e-b1b1b18f62fc

Message 7 of 17
mekanikproje
in reply to: timgrote

I sent a message

Message 8 of 17
JamesMaeding
in reply to: timgrote

on looped systems, or only non?

I'm a water guy so have used WaterCAD for years. Wish it was not Bentley owned.

I think the housekeeping functions and dialog boxes are way more work that the hydraulic calcs.

I wish we had competition to watercad, but its parent-child "scenario" structure is done right.

You can set up a system, then have 12 different demand situations. The hub-spoke structure is always the same for a model, but the pipe sizes and demands at nodes are variable per scenario.

We used to pay like $1000 a year for our network seats, now its $2500 per person per year, non-network.

Don't ever buy Bentley network seats (Select system), just don't.


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

Message 9 of 17
mekanikproje
in reply to: JamesMaeding

no calculation, it will assign diameter according to the number of blocks from the table. simple method required. it will be in tree structure. no ring bay pass

Message 10 of 17
JamesMaeding
in reply to: mekanikproje

@mekanikproje 

my reply was to @timgrote , about his program.

I know you are no loop and table driven sizes.

You need to decide on your budget to hire someone to do this, and also define exactly what you want.

Its interesting to me that you want c# code, as that implies you have programming knowledge.

Do you intend to maintain or troubleshoot the code?

thx


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

Message 11 of 17
timgrote
in reply to: JamesMaeding

@JamesMaeding 

I used WaterCAD when it was still Hydronet (I think).

 

Raindrop does looped systems via the EPANET engine. I haven't implemented all of the types yet, but the plan is to release a basic EPANET ->CAD interface later. I hear you on the interface, way too much time spent there, and I haven't even implemented demand scenarios yet!

 

 

For non-looped systems I just calculate with Hazen-Williams.

timgrote_0-1712687369858.png

 

Message 12 of 17
mekanikproje
in reply to: timgrote

I think this network structure is difficult, I could not find clear solution studies on the internet as code.

Message 13 of 17
JamesMaeding
in reply to: timgrote

@timgrote 

Hey, that is awesome! I've wanted an alternative to watercad and was wondering if I could hook to an underlying proven engine. If I could replace watercad and flowmaster, it would save us over $10k a year and no more Bentley fees except microstation.


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

Message 14 of 17
JamesMaeding
in reply to: timgrote

@timgrote 

I've been looking into EPANet. I'd heard of it but somehow never focused on it.

There is even a .net port of it but its 4 years old. Sometimes being able to debug old code is better than latest though.

I've never done c++ coding in VS but that is an option I bet I'll get into.

One of the issues on a cad interface for something wanting a skeleton model, is how you teach cad what is a pipe, node, demand, and so on. Its essentially the same as GIS info, entities with tables attached, but things like nodes could be blocks. I typically record data on entities as xrecords, but xdata and some other choices come to mind.

If you don't mind saying, how do you record info on entities such as their size and name?

For nodes?

I've done that extensively for our civil3d replacement tool which generates 3d stuff that needs to act as a group most of the time, but is still generic entities, no custom objects. I use xrecords and entity handles to update groups of stuff. If things bet messed up, you erase all the "child" things and the parents remake them and now handles are correct. This means you have to have editing tools too, no acad "break" commands as you get new handles and ruin the dynamic updates.


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

Message 15 of 17
timgrote
in reply to: JamesMaeding

@JamesMaeding 

I've been using xdata to store info on blocks(nodes) and polylines(pipes). With xdata I can filter by appname (EPANET_LINK) and easily grab all the links in the drawing. Data such as velocity, pressure, etc is stored as xdata on the polyline as well. The user can access that data via our properties panel.

 

I'm using native objects as well, one of my goals was to avoid custom objects. I do use groups to link pipes and flow arrows together, but I'm not completely happy with the result. I also use handles for tying together entities such as labels to objects. Writing handles as xdata leads to problems when the user copies entities around. 

 

I looked into the C# EPANET implementation back in the day, but it needed too much work. I'm not doing any C++. I'm literally writing up an input file and evaluating with epanet2.dll I could see switching to a .NET version once I get more spare time (yeah right!)

Message 16 of 17
JamesMaeding
in reply to: timgrote

@timgrote 

Thanks for your reply.

Xdata has a size limitation I ran into so xrecords were next choice.

I wanted to ask, you make the input file and evaluate with the dll.

I'm reading through how to do that but is that dll com accessible?

Or is is a command line thing you call from shell with params for input and output file?

Or other, any hints appreciated.


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

Message 17 of 17
timgrote
in reply to: JamesMaeding

@JamesMaeding 

We're using P/Invoke to call functions in the dll. I create an input file, run it, then query the model with ENgetlinkvalue. That way I didn't have to write a parser for the report values. You can iterate the links and nodes and write those values to block/polylines in xdata. 

 

I think that's covered in the documentation, but I have to admit it's been a long time since I've looked at it.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report