Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

Custom Feature: Cable/Wire Routing

NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,714
edited April 18 in FeatureScript
Cable/Wire Routing: https://cad.onshape.com/documents/3599036701247d65f0106997

There have been many wiring custom features created over the years, each using a different approach and each having different strengths, but none focused on the end-to-end process. This new set of custom features takes the best ideas from those existing features and combines them into a process-driven cable and wiring suite that takes a CSV file input from a 2D electrical schematic package of your choice, manages the routing of the cables/wires and produces wire length tables. Please watch the videos below for instructions on how to set it up and how to use the new features.

Tutorial videos:

1. Creating a connector library (also see update 1.178)

https://onshape.wistia.com/medias/44qqsj73xc?embedType=async&videoFoam=true&videoWidth=1280


2. Creating clips (also see updates 1.176.0, 1.176.1)

https://onshape.wistia.com/medias/kb988gd5n4?embedType=async&videoFoam=true&videoWidth=1280


3. Importing a from-to wire list (optional - see update 1.179)

https://onshape.wistia.com/medias/cwfkicq4gg?embedType=async&videoFoam=true&videoWidth=1280


4. Setting up the cable/wire environment (also see updates 1.170, 1.179)

https://onshape.wistia.com/medias/ni4fkgfjx3?embedType=async&videoFoam=true&videoWidth=1280


5. Inserting connectors and assigning references (also see update 1.179)

https://onshape.wistia.com/medias/hwgge5dq9f?embedType=async&videoFoam=true&videoWidth=1280


6. Cable/wire & harness routing (also see updates 1.170, 1.171, 1.179)

https://onshape.wistia.com/medias/2kp2tt45pc?embedType=async&videoFoam=true&videoWidth=1280


Further updates to these features can be found here:
1.170 https://forum.onshape.com/discussion/comment/95565/#Comment_95565
1.171 https://forum.onshape.com/discussion/comment/96725/#Comment_96725
1.173 https://forum.onshape.com/discussion/comment/97447/#Comment_97447
1.174 https://forum.onshape.com/discussion/comment/98412/#Comment_98412
1.176.0 https://forum.onshape.com/discussion/comment/99289/#Comment_99289
1.176.1 https://forum.onshape.com/discussion/comment/99800/#Comment_99800
1.178 https://forum.onshape.com/discussion/comment/101561/#Comment_101561
1.179 https://forum.onshape.com/discussion/comment/102158/#Comment_102158
Senior Director, Technical Services, EMEAI
«134567

Comments

  • S1monS1mon Member Posts: 3,039 PRO
    @NeilCooke

    This is impressive. Just quickly skimming the FeatureScript, it's amazing how much functionality and power is contained in ~2.4k lines of code.

    Is the plan for this to be a bit like the progression of the Beams custom feature into the Frames built-in features?

    Some wish list items for the next updates:
    1. More than one wire type per cable
    2. Stranded/solid metadata option
    3. Ribbon cables
    4. Clip options which show cables next to each other or in a bundle, not coincident
    5. Simple straightened cable drawings (not full pin board looms etc at first)
    6. Heat shrink or tag options near ends of cables
    7. Fixed length wires where some point or tangent vector is driven by the length

  • eric_pestyeric_pesty Member Posts: 1,947 PRO
    @NeilCooke
    This looks really impressive!

    I haven't had a chance to play with it yet but here are a couple of things stand out at first glance:

    - Strip length generally ends up being different at both ends of wires/cables. Maybe it should be set in the CSV per terminal instead of in the route interface?
    - Some way to round the values for length, at least in the tables, would be nice (maybe that can already be done)
    - "fixed length" option for the stripped section of cables.
    - Obviously the ability to generate straight representations would be really helpful, that could be a separate feature that takes a single wire/cable and generates a straightened representation from the available data. Would be really simple for a wire, a bit more involved for cables although it could be "schematic" with just a straight distance between the end of jacket and the end of the cable (i.e. ignoring the length of the "bends" to show the ends spread out in one plane). This would require using rounded values so that wire ends all line up when they are within the rounding value. Less ideal but the rounding could be applied at that stage.

    Some cosmetic improvements for wire within a cable and wires/cables in clips to not interfere with each other.
    - Maybe some way to offset each cable from the clip axis manually would solve the second part?
    - Maybe clips would have to be defined with an "area" for cables to go through (picking a reference "pierce" surface for example)? This could also serve as way to check the clip size is appropriate for what is going through it?
  • MichaelPascoeMichaelPascoe Member Posts: 2,012 PRO
    Very nice!

    Learn more about the Gospel of Christ  ( Here )

    CADSharp  -  We make custom features and integrated Onshape apps!   Learn How to FeatureScript Here 🔴
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,714
    That's quite the backlog of feature requests! Although, I already have most of those on my list.

    @S1mon - there will not be a built-in wiring feature in Onshape for some time, so I took the opportunity to create a prototype to get feedback/requirements and to provide something useful in the meantime. You can currently have more than one wire type per cable, but the cable diameter calc is based on all wires being the same diameter (otherwise it would be too compute intensive to pack dissimilar wire sizes). Ribbon cable and fixed length are hard to do. 

    @eric_pesty - I have just release V2 which includes different strip lengths at each end. The rounding of wire lengths follows the document unit settings. Offsetting the clip axis is hard because until a cable is regenerated the clips (or other cables) have no idea what exists. I'll have a think about that one.
    Senior Director, Technical Services, EMEAI
  • eric_pestyeric_pesty Member Posts: 1,947 PRO
    edited August 2022
    NeilCooke said:
    That's quite the backlog of feature requests! Although, I already have most of those on my list.


    Well you asked ;)!

    I'll check out the different strip length options.

    I see what you mean about clips and not knowing where things will end up... Of course it's possible to manually create multiple "clips" with offsets but it's a bit tedious. I understand the limitation of working with a context like this but it would be really nice if you could somehow define the clip at the part level rather than have to re-create it for every instance of the same clip in the assembly!

    I guess the clip could include some reference surfaces that you could "zero offset" and then use with mate connectors to create clip features (I still don't understand why you can't use implicit mate connectors on context geometry, this would save so much time...) but it does seem like a bit of a convoluted workflow.

    For the rounding I was asking about rounding the actual numbers to a user specified increment rather than just adjusting the precision shown in the table. That would become especially important when generating "straight" version as you wouldn't want the ends of a cable to be just slightly different (by a fraction of a mm) when you would make the actual thing by cutting them all to the same length.
    We typically make sure our wire/harness drawings have nice "round" numbers (maybe in 5mm increments).

    Here's an example I did when I was exploring workflow options for wiring. I automatically generate the length of a straight extrude to give me an even spacing between ring terminals in my "straight wire" assembly (used for the drawing) from the measured length of a freeform spline (it's "shared with support" so you should be able to see it?). In an ideal world we would be able to reproduce something like this...

    https://cad.onshape.com/documents/cce8cbd2f7fc3932f9ed923e/w/e2f7142396922c9adbd1e95d/e/54f3ad06852be739839286dd





    There's another feature I didn't mention last as I think it might be beyond the scope here... but re-using the same cable in a different assembly is something we do have to worry about, and we often end up making a harness a bit longer than "ideal" in one place so that we can use it somewhere else, but that is all about starting "from the other end" and dealing with "constant lengths".

    In my example above I did experiment with inserting my harness in a separate assembly and generating a new 3D model, including using some "sensors" to check the length is within "useable" tolerance. It would be great if this tool could help with this workflow as well!
    Maybe it's already doable to some extent (haven't tried)... Can you create new "wire ref" and "routes" that re-use the same "references" (and use a different context)? Then it's just a matter of manually adjusting the path to make sure you have the same lengths and then managing configurations/composite parts to create two representation of the same wire/cable. Side note (tangent warning): this is one very common use case where we would want to have multiple configurations of a "thing" treated as a single "item" in the release process (same part number and REV, listed on one line on a BOM, etc...)

    I noticed that this will unfortunately not play well with configurations as it leverages arrays in features. This is probably ok, we have found in our workflows the simplest way to handle configurations of different wire shapes is configure the selection on the composite at the end.
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,714
    @eric_pesty - that’s some great info, thanks. When talking with my Creo comrades, they say their biggest #1 request (and something even they do not do well) is to reuse “standard” cables. Never say never I say. 

    Only the support team can see docs shared with support, but with your permission (I can use your above comment) hopefully they will let me in. 
    Senior Director, Technical Services, EMEAI
  • shawn_crockershawn_crocker Member, OS Professional Posts: 869 PRO
    @NeilCooke
    I can hear your controlled exhilaration underneath that proper accent!  This is absolutely incredible!  Mind bottling as some may say that this has actually been realized!
  • EvanReeseEvanReese Member, Mentor Posts: 2,186 ✭✭✭✭✭
    Awesome work, Neil! I see some familiar UI elements ;) . I can't wait to dig into this, and especially to try it out when the right project comes around. I second other's request for an additional feature in the suite to make a straight version of the cable harness for drawings. It might also make sense to allow for some custom sections that are drawn with conventional tools. I imagine this feature might struggle to represent something like this (though I've not tried it)

    Evan Reese
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,714
    Thanks @Evan_Reese - I didn't deliberately steal your ideas, but as I added more capabilities, the similarities were hard to ignore!

    You can currently do that jog using a sketch, then 3d fit spline/edges, then select the spline in the "clip" area of the route feature. I will add this as a native option in the clip feature. Thanks for your great UI!
    Senior Director, Technical Services, EMEAI
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,714

    For the rounding I was asking about rounding the actual numbers to a user specified increment rather than just adjusting the precision shown in the table. That would become especially important when generating "straight" version as you wouldn't want the ends of a cable to be just slightly different (by a fraction of a mm) when you would make the actual thing by cutting them all to the same length.
    We typically make sure our wire/harness drawings have nice "round" numbers (maybe in 5mm increments).

    Presumably you would always round up to the nearest 5mm?
    Senior Director, Technical Services, EMEAI
  • eric_pestyeric_pesty Member Posts: 1,947 PRO
    @NeilCooke
    let me know if support won't let you access this document!

    We could use this for the first 1/2 of the workflow (creating the routes and "installed" models), and then create Straight models "manually" using our current workflow. One thing that would be useful would be if this generated variables with the lengths of each path, this way we could use that to create parametric straight versions. Although I'm not sure how to deal with the rounding issue. In the example above I'm adding the distance between the end of the wire and the center of the ring terminal before rounding so that would still have to be handled... It's just nice to end up with "irrational" numbers in the dimensions!

    Currently we don't actually bother setting up the variables as shown in the example above as it's not really worth it for our typical harness/wires. We just manually set the straight length to be "close enough" to the real 3D route and give us nice round numbers on the drawing so we could do this with the current iteration of this feature.

    I haven't had a chance to try it end to end yet (just made a copy of the doc and poked around a bit). @Evan_Reese, the "clips" add a straight sections and break up the splines so I think by defining 3 clips (per wire, so 6, which is a bit of work... probably using mate connectors with offsets on an offset surface from the context), you should actually be able to generate the wires going through a rib like this, would be fun to try.

  • EvanReeseEvanReese Member, Mentor Posts: 2,186 ✭✭✭✭✭
    NeilCooke said:
    Thanks @Evan_Reese - I didn't deliberately steal your ideas, but as I added more capabilities, the similarities were hard to ignore!

    You can currently do that jog using a sketch, then 3d fit spline/edges, then select the spline in the "clip" area of the route feature. I will add this as a native option in the clip feature. Thanks for your great UI!
    Definitely didn't mean to suggest you stole anything. Your implementation is unique to your tool. I also realize that when tackling a niche problem people will come up with similar things independently too. (If I recall, cameras were invented independently on both sides of the Atlantic at about the same time). If anything I'm just flattered by any similarity. If my solution is similar to Neil's, it's probably pretty good.

    I hadn't played with it yet so I wasn't sure if the "clip" curve had any special attributes assigned or if any curve would do it. If it's any curve, then the fit spline option works well enough for me.
    Evan Reese
  • eric_pestyeric_pesty Member Posts: 1,947 PRO
    NeilCooke said:

    For the rounding I was asking about rounding the actual numbers to a user specified increment rather than just adjusting the precision shown in the table. That would become especially important when generating "straight" version as you wouldn't want the ends of a cable to be just slightly different (by a fraction of a mm) when you would make the actual thing by cutting them all to the same length.
    We typically make sure our wire/harness drawings have nice "round" numbers (maybe in 5mm increments).

    Presumably you would always round up to the nearest 5mm?
    5mm was just an example, obviously this would have to be adjustable and likely be able to turn it off altogether. There are some complications as I mentioned in my last post as the "round number" we use would typically include whatever connector/terminal is installed so it might be hard to get exactly what we want in one step... That said we could always do a manual adjustment at the end (like a move face to get the end to end of the harness to fall where we want it to on the drawing) and it would be easier to manage if the cut wire length changed in predictable "whole" increments rather than random irrational numbers.
    I do think the most critical place for this would be when generating straight version of a jacketed cable were the wires are "close" to the same length and should really "snap" to be aligned on the drawing. Maybe I'm overthinking it and there should just be an option to "align to the longest" or something like this for the straight version and the rest can be handled with a couple of "manual" steps like a move face or whatever to align/offset things as required...

    Didn't realize the "clip" could be more than just a line/reference point...
    Maybe a good workflow would be to include a reference curve in the "clip" model and then "super derive" these into the wire part studio to create a bunch of identical clips (would still need to create some "zero offset" surfaces to be able to have MCs for the super derive) more quickly.
    A context doesn't bring in curves, does it (because that could speed things up quiet a bit...)?
  • antlu65antlu65 Member Posts: 59 EDU
    Wow this looks amazing!
  • Axel_KollmenterAxel_Kollmenter Member Posts: 415 PRO
    edited August 2022
    Super great FS! Thank you.

    @S1mon +1 for the Ribbon Cables and your number 5
    Best regards,

    Axel Kollmenter
  • Axel_KollmenterAxel_Kollmenter Member Posts: 415 PRO
    edited August 2022
    I got an error Message while selecting the Wire Data:
    This is my self created .csv document:

    How do I solve this?
    Best regards,

    Axel Kollmenter
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,714
    @Axel_Kollmenter check if you have a space after "From Ref" in the header - I have reproduced and will fix in the next update - thanks.
    Senior Director, Technical Services, EMEAI
  • Axel_KollmenterAxel_Kollmenter Member Posts: 415 PRO
    Thanks for your fast reply Neil, unfortunatly there is no space after "From Ref". I can´t add my CSV File so I attached the excel table which is the origin to my CSV file. I updated every file but the same error still exists.
    Best regards,

    Axel Kollmenter
  • S1monS1mon Member Posts: 3,039 PRO
    I can see a space before “To Ref”. Would that cause a similar issue?
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,714
    I imported as is and got an error on wireToRef and works after my fix. I was hoping to rollup a few things, but i can submit the fix now if you prefer.
    Senior Director, Technical Services, EMEAI
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,714
    Fixed issue with leading/trailing whitespace in CSV headers. @Axel_Kollmenter
    Added wireLengthPrecision variable to control tolerance of measured wire lengths. @eric_pesty
    Senior Director, Technical Services, EMEAI
  • eric_pestyeric_pesty Member Posts: 1,947 PRO
    NeilCooke said:
    Added wireLengthPrecision variable to control tolerance of measured wire lengths. @eric_pesty
    Nice!
    Still haven't had a chance to create something "from scratch" (starting from a CSV) but seeing the rounded values in the table is very "soothing"!
  • Axel_KollmenterAxel_Kollmenter Member Posts: 415 PRO
    Thank you very much @NeilCooke ! :)
    Best regards,

    Axel Kollmenter
  • Axel_KollmenterAxel_Kollmenter Member Posts: 415 PRO
    edited August 2022
    Hello @NeilCooke, I´m sorry to say that it still dont work... I have removed all superfluous space characters (even if this works now (I saw it in your csv file)), saved the excel file as an csv file, reloaded your Featurescripts and still got the same error message :(

    Best regards,

    Axel Kollmenter
  • Axel_KollmenterAxel_Kollmenter Member Posts: 415 PRO
    If I want to save my excel file as an csv, there are 4 different options to save it.... is there any difference?
     


    Best regards,

    Axel Kollmenter
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,714
    @Axel_Kollmenter I tried all 4 types and loaded fine - attached is csv from my excel for you to try (you never know).
    Senior Director, Technical Services, EMEAI
  • Axel_KollmenterAxel_Kollmenter Member Posts: 415 PRO
    Another question: Is it possible to define Pins at a standard part? So for example we have a standard electro component and one pin is always "L/+" "PE" and "N/-" Do we have to define this in every new document?
    Best regards,

    Axel Kollmenter
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,714
    Another question: Is it possible to define Pins at a standard part? So for example we have a standard electro component and one pin is always "L/+" "PE" and "N/-" Do we have to define this in every new document?
    Working on it.... but out for the next 2 weeks.
    Senior Director, Technical Services, EMEAI
  • Axel_KollmenterAxel_Kollmenter Member Posts: 415 PRO
    NeilCooke said:
    @Axel_Kollmenter I tried all 4 types and loaded fine - attached is csv from my excel for you to try (you never know).

    Thank you! Your file worked. Maybe you got magical hands ^^
    Best regards,

    Axel Kollmenter
  • Axel_KollmenterAxel_Kollmenter Member Posts: 415 PRO
    edited August 2022
    NeilCooke said:
    Another question: Is it possible to define Pins at a standard part? So for example we have a standard electro component and one pin is always "L/+" "PE" and "N/-" Do we have to define this in every new document?
    Working on it.... but out for the next 2 weeks.

    Awesome! Thank you! This would be the so nice. :smiley:
    Best regards,

    Axel Kollmenter
Sign In or Register to comment.