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.

Wiring Harness Struggles

john_hauckjohn_hauck Member Posts: 28 ✭✭
edited February 10 in General
Greetings OnShapers!,

I created a wire harness (see pic below), but I feel a bit dirty about how I went about it.
I would love your thoughts on how this could be reworked better.
Here is the Document.




So first let me list the goals that I have for this task:
  1. To use the Wiring FeatureScript written by Jon Sorrells & Noa Flaherty as highlighted here: https://www.onshape.com/cad-blog/onshape-custom-feature-spotlight-wiring.
  2. To use wire lugs from another document or imported from STEP files.
  3. To have the harness adapt to changes in the top level assembly, by creating it in the context of the top-level assembly.
  4. To have the harness be an assembly containing the wire parts and with imported lug parts or assemblies.
  5. To be able to show the wire harness with lugs in its own assembly for creating a BOM and drawings of the harness.
  6. To be able to show the top-level assembly with the wire harness assembly hidden (including hiding the lugs).
So here is my approach.
  1. To create the wire parts in context of the top level assembly, they must be created in a Part Studio.
    I call this the Wire Harness Part Studio.
    I decided to create a sketch on the face of every wire spade (male connector) in the assembly, and then create a point in the center of the spade for the Wiring FeatureScript (see picture below).
    I then created all the needed wires, and added them to an Composite Part (and kept it "open").
  2. For adding lugs into the Wire Harness Part Studio I considered the following:
    I could draw them from scratch in the Wire Harness Part Studio and duplicate them as needed. Drawing lugs is not a re-usable approach, so that is out. Furthermore, cloning and mating in a PartStudio using the Transform by Mate Connectors seems barbaric compared to the ease of mating parts in assemblies.
    It is not possible to insert parts into a part studio like you can in assemblies, so that is out.
    It is possible to "derive" parts from another part studio as a way of "inserting". Yet derived parts cannot be assemblies nor can they be composite parts, so that is out. Furthermore, it seems silly since nothing is being really "derived".
    So I decided not to put lugs into the Wire Harness Part Studio.
  3. The lugs then must go into an assembly.
    They could be attached to the wire spades in the top level assembly or existing sub assemblies. This would however pollute those assemblies with lugs without wires which seems silly. Mainly, however, I really want the lugs and wires to be in their own wiring harness assembly.
    Therefore, I decided to create an assembly called Wire Harness Assembly that contains the composite wire part and one lug mated to every wire end. I then added this wire harness assembly to the top level assembly.
  4. However, I now have a Wire Harness Assembly and a Wire Harness Composite Part in the top level assembly. So the wires are essentially in the top level twice. I cannot remove the Wire Harness Composite Part because it is my only way of editing the wire harness in the context of the top level assembly. So, I simply make the composite part hidden (see picture below).
I hope I clearly explained my approach and the reasons I did not take other paths.





I now understand why Jon & Noa demonstrate the Wiring FeatureScript inside of a part studio where everything is created from scratch or brought in via "derived" and did not create lug connectors.

I believe there is room for improvement for wire harnesses in OnShape. For example:
  1. Inserting a composite part into a part studio might be useful (I think I would vote against this though).
  2. Better mating in part studios might help (I think I would vote against this though).
  3. Editing one sub assembly in the context of another sub assembly might be useful (I am starting to like this more and more).
  4. Have standard (and extensible) lugs (and other wiring parts) be part of the Wiring FeatureScript seems like a wonderful solution here. I'd like a lot of feedback before considering undertaking the task myself.
Thanks for taking the time to read this. I look forward to your thoughts.

- John Hauck
Tagged:

Comments

  • LavonLavon Member Posts: 25
    edited February 10
    @john_hauck I have been wondering about the exact same thing, only my situation happens to be hydraulic hoses instead of wire harnesses. I would also vote for the ability to edit subassemblies in the context of other assemblies.

    In Solidworks, I make an assembly for the hose, consisting of the hose and the two fittings on the ends, with one fitting mated to the origin and the other free floating at this point. I then insert that hose assembly into the assembly where it will be used, and mate the one fitting to the fitting that it connects to in the assembly. I then edit the hose assembly in context of the other assembly, start a 3d sketch and project the geometry of the fitting that the other end of the hose will be joining up with into that 3d sketch. Then I can simply open my hose assembly, mate the fitting that is not constrained yet to that 3d sketch, then constrain the 3d spline for the hose to the fittings.

    To do this we would need to be able to make sketches in assemblies in Onshape, which I don't think is possible? Unless they would allow mating between assemblies somehow, in which case you wouldn't need that 3d sketch.
  • Piotr_Smektała_VBPiotr_Smektała_VB Member Posts: 25 PRO
    edited February 10
    What about such a route:
    1. Insert all lugs into the Main Assy.
    2. Select one of the lugs.
    3. Place a mate connector on that lug.
    4. Choose "Create Part Studio (PS) in context".
    5. Choose that Mate Connector as an origin for that new PS.
    6. Execute all the wiring between lugs inside that new PS using shadowed Assy.
    7. Return to Main Assy.
    8. Select all wiring and lugs and choose "Move to New Assembly".

    Now you have the Main Assy with the Sub Assy (made of wiring and lugs).

    Am I missing something?

  • john_hauckjohn_hauck Member Posts: 28 ✭✭
    edited February 10
    What about such a route:
    1. Insert all lugs into the Main Assy.
    2. Select one of the lugs.
    3. Place a mate connector on that lug.
    4. Choose "Create Part Studio (PS) in context".
    5. Choose that Mate Connector as an origin for that new PS.
    6. Execute all the wiring between lugs inside that new PS using shadowed Assy.
    7. Return to Main Assy.
    8. Select all wiring and lugs and choose "Move to New Assembly".

    Now you have the Main Assy with the Sub Assy (made of wiring and lugs).

    Am I missing something?

    Thanks for the thoughts.

    I did exactly that a few days ago, and then trashed it because I did not want all the lugs in the main assembly.

    There are my goals (specifically see #4-6):
    1. To use the Wiring FeatureScript written by Jon Sorrells & Noa Flaherty as highlighted here: https://www.onshape.com/cad-blog/onshape-custom-feature-spotlight-wiring.
    2. To use wire lugs from another document or imported from STEP files.
    3. To have the harness adapt to changes in the top level assembly, by creating it in the context of the top-level assembly.
    4. To have the harness be an assembly containing the wire parts and with imported lug parts or assemblies.
    5. To be able to show the wire harness with lugs in its own assembly for creating a BOM and drawings of the harness.
    6. To be able to show the top-level assembly with the wire harness assembly hidden (including hiding the lugs).
    - John
  • john_hauckjohn_hauck Member Posts: 28 ✭✭
    edited February 10
    Lavon said:
    @john_hauck I have been wondering about the exact same thing, only my situation happens to be hydraulic hoses instead of wire harnesses. I would also vote for the ability to edit subassemblies in the context of other assemblies.

    In Solidworks, I make an assembly for the hose, consisting of the hose and the two fittings on the ends, with one fitting mated to the origin and the other free floating at this point. I then insert that hose assembly into the assembly where it will be used, and mate the one fitting to the fitting that it connects to in the assembly. I then edit the hose assembly in context of the other assembly, start a 3d sketch and project the geometry of the fitting that the other end of the hose will be joining up with into that 3d sketch. Then I can simply open my hose assembly, mate the fitting that is not constrained yet to that 3d sketch, then constrain the 3d spline for the hose to the fittings.

    To do this we would need to be able to make sketches in assemblies in Onshape, which I don't think is possible? Unless they would allow mating between assemblies somehow, in which case you wouldn't need that 3d sketch.
    It seems you and I are on the same page here. I think simply allowing one sub assembly to be edited in the context of a containing sub-assembly would solve it. I don't think we would need 3D sketches. I think mates in context (which would be awesome) should do the trick.
  • Piotr_Smektała_VBPiotr_Smektała_VB Member Posts: 25 PRO
    Using my route you will achieve this in the last step.
    4. Harness (including lugs and wiring) is in a separate Harness Assy.
    5. You can show it alone, as it is in separate tab.
    6. Your Main Assy has all the parts of the assembly and Harness Assy as a separate entry in the list of parts. So, you can hide it in one click.

    Quick assy made this way:

    Sorry, if I'm still missing something.
  • LavonLavon Member Posts: 25
    @piotr_smektała if you did it that way would the wire harness subassembly still update when you moved parts around in the other assembly?
  • john_hauckjohn_hauck Member Posts: 28 ✭✭
    edited February 10
    Using my route you will achieve this in the last step.
    4. Harness (including lugs and wiring) is in a separate Harness Assy.
    5. You can show it alone, as it is in separate tab.
    6. Your Main Assy has all the parts of the assembly and Harness Assy as a separate entry in the list of parts. So, you can hide it in one click.

    Quick assy made this way:

    Sorry, if I'm still missing something.
    I think I failed to completely understand your process before responding - and for that I apologize.
    Thank you for being persistent with me.

    So I followed your instructions (with a few minor modifications) and here are my thoughts:

    >> 7. Return to Main Assy.
    Just to clarify I did not simply return to the main assembly, but I selected "Insert and go to Assembly", which is what I think you meant.
    Also, instead of selecting all the wires for the insert, I first created a composite part of all the wires. I think this is in the spirit of your suggestion.
    I then completed step 8 as you indicated and everything worked!

    So now I have a part studio with the wires - and this still has a reference to the context of the main assembly at the time the wires were created. That is, the lugs are still in the main assembly because the context was created before step 8. I also have an assembly with the lugs and the wires. The main assembly includes the wire assembly.

    Now I interact with this document as follows:

    I updated the context of the wire part studio. This worked fine and the lugs are still visible. The reason they are visible is because that while the lugs were removed from the main assembly, they show up because they are now in the wire and lug assembly (which is in the main assembly). Very nice!

    Now I changed the position of some of the parts that the lugs were mated to (in your step #1). The wires did not automatically follow the new lug locations (as expected). So I opened the wire part studio and selected the context. This context shows the original assembly and not the updated positions (as expected).  I then selected "Update Context" and the new location of the sub assemblies are viewable in the ghosted image, and the wires did not move on some of the lugs but not on the others. It turns out that the reason it did not move on one was my fault. I did not properly constrain the point on the sketch that the wire was connected to. I fixed that, and poof it all moves as needed.

    So now I went back to the main assembly, added two more lugs in new locations, then updated the context of the wire part studio, created two new sketches on those lugs, created the wire part between the two new sketches, and added the wire to the composite part of wires.

    Now all I need to do is move those two new lugs into the wire and lug assembly. Hmmm. I'm stuck. Soooo close!
  • bradley_saulnbradley_sauln Moderator, Onshape Employees, Developers Posts: 328
    I made a video a while back going over how Perrinn approaches this in their public document. :https://cad.onshape.com/documents/f31dba16eb99870c9595e116/w/14f3a440fe7d6bddec4bf3f6/e/7b1d4a9b4470280b5aa0ede2

    tl;dr Create a part studio in context, create sketches referencing the assembly geometry, create projected curves for the cable path. Make your mounts/harnesses from there. After changing the assembly, rmb > update context to see changes to the cables.
    Engineer | Adventurer | Tinkerer
    Twitter: @bradleysauln


  • LavonLavon Member Posts: 25
    Thanks @bradley_sauln I think that's a little different though. If I saw right, that was only the cables, and no connectors of any sort on the ends. Doing that is simple enough, but it's a little different if you need to have subassemblies with the cables and other parts in that assembly.
  • LavonLavon Member Posts: 25
    Seems to me that regardless whether it's needed in this case or not, you should be able to edit subassemblies in context of other assemblies...
  • john_hauckjohn_hauck Member Posts: 28 ✭✭
    OK, I've been mesmerized by @Piotr_Smektała_VB' s suggestion, and I think there is something very fishy going on here (perhaps a bug).

    So I created this simplified document Wireception.
    1. Create Cube part
    2. Create Hex part
    3. Create assembly Asm with 2 Hex and 2 Cube and fun mates
    4. Create part studio IC in context from Asm
    5. Create 2 sketches in IC on the 2 cubes in Asm
    6. Create one point on each sketch
    7. Create Wire from one sketch to the other
    8. Click "insert part into assembly" (the Wire)
    9. Select the Wire and both cubes and "move to new assembly" called Bsm
    10. Create version V1:

      Tab Asm: The Wire is in context of the assembly (arrow) - but nested inside Bsm - is that legitimate or a bug? I smell a problem!
      Tab Bsm: The Wire is not in context of the assembly (no arrow) - hmmm.
      Tab IC: The wire remembers the context of Asm (two arrows on each sketch).

    11. So now we proceed.
    12. Change a mate in Asm to move the cube further away.
    13. Update the context of IC.
    14. Note that Bsm does not update.

    15. Create version V2
    I think think the process of creating a "move to new assembly" of a part in context messes up OnShape in some way.
    The cubes in Bsm are not mated in any way either.

    - John
  • malay_kumarmalay_kumar Onshape Employees, Developers Posts: 84
    @john_hauck In subassembly BSM cube is not in desired place because the context part is generated based on position of top assembly (context) and not subassembly. In Onshape assemblies are flexible in subassembly cube can be in a different place than in top. If you want to control that then add a mates in subassembly.

    Also, in your original assembly, you could delete the original hidden composite and set the composite in subassembly as Context primary instance' by right clicking. The context update as long as there is primary instance. I have made that change here https://cad.onshape.com/documents/7207f67811fdbdd4dda4887b/w/3f428e27d6b0350320dfd374/e/5c26bbcd16abd1747ac763e1

    Essentially this is same as your simplified document created using Move to assembly once mate are added to make sure subassembly position is also correct. 

    Hope this helps. 
  • john_hauckjohn_hauck Member Posts: 28 ✭✭
    @john_hauck In subassembly BSM cube is not in desired place because the context part is generated based on position of top assembly (context) and not subassembly. In Onshape assemblies are flexible in subassembly cube can be in a different place than in top. If you want to control that then add a mates in subassembly.

    Also, in your original assembly, you could delete the original hidden composite and set the composite in subassembly as Context primary instance' by right clicking. The context update as long as there is primary instance. I have made that change here https://cad.onshape.com/documents/7207f67811fdbdd4dda4887b/w/3f428e27d6b0350320dfd374/e/5c26bbcd16abd1747ac763e1

    Essentially this is same as your simplified document created using Move to assembly once mate are added to make sure subassembly position is also correct. 

    Hope this helps. 

    Your first paragraph makes sense.

    Your second paragraph is teaching me something I did not know about - "Set as primary instance". I took a screen shot of me about to perform that action (green rectangle). Can you confirm this is exactly what you are explaining here? To follow your directions further, I believe you mean I would also delete the Harness component part (red rectangle) too. Correct?

    Thank you for teaching me something new.

    - John



  • malay_kumarmalay_kumar Onshape Employees, Developers Posts: 84
    @john_hauck You got it right. A context is associated with a primary instance in assembly to position assembly in partstudio at correct relative location. The primary instance is set when context is first created from assembly but if for some reason that instance is deleted and added back then context can be repaired using 'Set as primary instance' option. When we restructure like 'Move to new assembly' then context is automatically repaired. 
  • owen_sparksowen_sparks Member, Developers Posts: 2,660 PRO
    Great thread folks :+1:

    I'm laying the groundwork for a similar workflow.
    The intention is a set of three featurescripts working sequentially to build wiring looms.
    (FS1) Simply gets the connectors required and positions them on user specified mate connectors.  (aka super derive; the FS is just a curated list of connectors that the user can pick from a list.)  Each derived part will bring in its own mate connectors, either to define the positions for the wires or the mating connector as appropriate.
    (FS2) This will take care of the wires themselves.  Using a curated list of wire types and colours and some array parameters for paths and connection locations. 
    (FS3) Makes 1 or more composite parts out of what has been built.

    So in theory one in-context Partstudio just has these 3 features (and probably some layout sketches for composite curves for cable paths) and we're done.  Oh and then we use some configurations if we want variants upon a theme.

    For simpler cables it could probably be one FS.
    It'd be nice to have an output of cable lengths required to build the looms.

    Thoughts?
    Cheers,
    Owen S.
    Business Systems and Configuration Controller
    HWM-Water Ltd
  • Per_Oskar_OdermalmPer_Oskar_Odermalm Member Posts: 8 PRO
    Many great ideas in this thred.

    In the end, I'm trying to something simlar to you, @owen_sparks

    But in the first stage, I am trying to make a pinout schematics. Unfortunately I will, right now, have to resort to import dxf:s of the connectors and make everything manually in Drawing.

    I'm trying to delve deeper in to FS, but right now my programmingskills are basic, at most.

    Cheeres,

    P-O O
  • john_hauckjohn_hauck Member Posts: 28 ✭✭
    edited February 18
    ...
    (FS1) Simply gets the connectors required and positions them on user specified mate connectors.  (aka super derive; the FS is just a curated list of connectors that the user can pick from a list.)  Each derived part will bring in its own mate connectors, either to define the positions for the wires or the mating connector as appropriate.
    (FS2) This will take care of the wires themselves.  Using a curated list of wire types and colours and some array parameters for paths and connection locations. 
    (FS3) Makes 1 or more composite parts out of what has been built.

    So in theory one in-context Partstudio just has these 3 features (and probably some layout sketches for composite curves for cable paths) and we're done.  Oh and then we use some configurations if we want variants upon a theme.

    It'd be nice to have an output of cable lengths required to build the looms.
    ...
    Owen, I agree that there is a lot of room for improvement!

    FS1 - I really think there is a strong case to be made that this should be done in an assembly. All the tools for importing and mating are in the context of an assembly. Deriving is just not the same. I really like it when I insert bolts from the standard content library, they are all set to be mated very nicely. An assembly is the place to assemble parts - including (in my mind) wire harness connectors. The down side is that OnShape does not support creating assemblies in context, so the goal of adding a wire harness as a sub assembly to a top level assembly is forcing us to use a Part Studio. Therefore, I reluctantly agree with your approach here.

    Yet I wonder if OnShape is correct in not supporting sub assemblies in context. Here is another approach... what if we stop trying to add a wire harness as a sub assembly to a top level assembly. What if we use the top level assembly as a sub assembly in our new top-top level wire hardness assembly (TTLWHA). Now we can add wire connectors however we wish in this new TTLWHA. Now we can use the existing wire harness part generator, or something a bit nicer...

    FS2 - I like the list of wire types and colors (sorry I type "American") as you describe. I also would like the ability to use mate connectors instead of sketches. The use of sketches makes things a bit barbaric. Mate connectors are awesome - because, well, that's their purpose. They can be re-aligned and moved, reoriented, and rotated. It's almost like they are made for this kind of work.

    I'd also like to see the ability to specify a maximum wire bend radius, and the ability to insert and re-order the wire routing locations. And of course it would be super cool to have "collision detection" and force those wires to stop intersecting each other and the model itself. If we had that, we could specify one point for a bundle of wires to pass through, and collision detection would force them to clump together but not intersect each other.

    That's all I've got for now.

Sign In or Register to comment.