Help for VB - Constraining, Manipulate, Snap or other suggestions

Michael Laursen

Help for VB - Constraining, Manipulate, Snap or other suggestions

Hi All,
I'm currently working on assemblies with a lot of piping components and i would like to have your ideas for the best way on "Constraining" the components together.

I have attached a picture of a simple assembly. My requirements are:

  1. Use VB-Script to do the "Constraining". (Constraints are not required)
  2. Able to rotate component independently from other components. E.G. Part A (see picture) needs to be rotated 90. it does not matter if it's clockwise or counterclockwise as longs it's consistent. Meaning if the picture shows the 0 position, it should always be positioned this way when entering 0. I hope you get my point.

 

What i have done:

  • A DesignTable/CSV holds the "Constrain" information E.G.
    PartA; Connection 1; PartB; Connection 2; Same/Opposit;Rotation Angle
  • DesignTable to hold the information of which parts to instantiate from ARM Catalog
  • I create coincidence constraints between two points on the center axis. This centers the two parts and i can control the orientation. (Same/Opposite)
  • Then i create and angle constraint between two planes i call "Rotation". This is my problem, since i don't have control over the rotation axis. E.G if one create an angle constraint between the ZX plane on an axisSystem on both parts, would it rotate around the x-Axis or the Z-Axis.?

    So maybe i should replace the Angle Constraint and use the ".Move" to rotate the part around a referenced axis..? I just don't know how to reference the rotation axis to my rotation Matrix. 

    Anyways, let me know if you have questions, suggestions or in any way could guide me in the right direction..

/Michael

 

Attachments

  • COE_Rotation_VBA.png (86.5k)

Little Cthulhu

RE: Help for VB - Constraining, Manipulate, Snap or other suggestions
(in response to Michael Laursen)

As far as I understand you're not using Piping Design workbench? If you are, why constraining?

Michael Laursen

RE: Help for VB - Constraining, Manipulate, Snap or other suggestions
(in response to Little Cthulhu)

Hi CtHulhu, 

You are correct, we are not using Piping Desing. 
Glad you commented, i saw another thread where you were linking to the german forum for axisSystem to AxisSystem transformation. But that forum are now closed. 

I have been trying move the parts by using the "position.getComponents"/ setComponent"  together with the transformation/rotation Matrix.. but i can't get the components to move from axis system to axis system... Only part to part. :-( 

I kind of understand but i haven't been successful.. :-( 
It would be great to see an example on the axissystem to axissytem move.. 

/Michael  



Little Cthulhu

RE: Help for VB - Constraining, Manipulate, Snap or other suggestions
(in response to Michael Laursen)

Why reinventing the wheel? Use Piping Design.

It utilises concepts of space reservation volumes called runs and each piping part is placed either on a run or at it's extremity. Thus a run can be viewed as a part with skeleton geometry (bends and segments) to which all piping parts are constrained to. Constraints should use skeleton's part natural axis system.

In reality you can't be serious about modelling pipes without Equipment And Systems modules. So I'm against encouraging self-made solutions on this one.

Michael Laursen

RE: Help for VB - Constraining, Manipulate, Snap or other suggestions
(in response to Little Cthulhu)

I agree that one should not reinvent the wheel... but with very little knowledge of the "Piping Design Workbench", it seems quite cumbersome to work with the piping design in CATIA V5.

 

As i see it If we choose Piping..

  • Need license. 
  • Special trained people
  • A huge workload up front to set environment, create and maintain libraries
  • You manually need to crate a run, then add the components. 
  • And maybe more.

 

All this when i can create a simple macro to read a simple csv/xml/excel file and create the assembly for me. The only thing i need to learn is to move the components with a AxisSystem to AxisSystem snap and then the option to rotate the part around a given axis/line.

 

Keep in mind that we create thousands of variants.. and this is not limited to "piping components" 

 

But i will still try to see if i can find training for the Piping Design.. 

 

/Michael  

Little Cthulhu

RE: Help for VB - Constraining, Manipulate, Snap or other suggestions
(in response to Michael Laursen)

CATIA documentation was enough for us to get going with Systems.

Why would you create a thousands variants of a system? You design variant that meet requirements and use it, generative methods doesn't apply here.

How do you want to use your model afterwards?

Michael Laursen

RE: Help for VB - Constraining, Manipulate, Snap or other suggestions
(in response to Little Cthulhu)

Hi Cthulhu, 

I find the CATIA Documentation a bit unorganized and easy to do step by step... but i'll give it a go.. :-) 

I would say it's basically the same system, but different variants. Lest say we have 500 different pumps, combined with different insulation, different Controls.. different height, length and width. This results in quite a lot of different variants. 

The Assemblies are used for rendering, simulations, calculations, documentation..and also used to generated different CAD formats like STEP or BIM models. So it's getting more and more important to have a 100% product range in 3D

 
Also when a customer enters our website, they should be able to configure the system, get a price, order and get a 3D model ready for download. That's why it's so important to automatically generate the assemblies on the fly.. 

/Michael

Edited By:
Michael Laursen[Grundfos Holding A/S] @ Dec 19, 2022 - 10:34 AM (Europe/Copenhagen)
Michael Laursen[Grundfos Holding A/S] @ Dec 19, 2022 - 10:34 AM (Europe/Copenhagen)

Little Cthulhu

RE: Help for VB - Constraining, Manipulate, Snap or other suggestions
(in response to Michael Laursen)

This is what I don't get. It sounds like you have a fully automated solution that would generate multiple variants at once, but I can't figure how it's possible without human assistance.

System with 500 pumps should be routed and adjusted by a human using automated tools to place controls, refine part variants, find optimal pipe configuration with regards to environment etc. So there's not going to be a magic button that would generate all variants unless you formalize all requirements and involve some kind of AI to valuate best of them.

If your solution requires an engineer to prepare all the data required for generation, it may take him not less time than to do the same job with Equipment And Systems.

 

simulations, calculations

No idea how you're going to do this with solid non-specialized parts. Unless you're willing to trace system topology yourself and reinvent connections model.

By the way, once done with design, Piping Design pipes can be solidifed.

Michael Laursen

RE: Help for VB - Constraining, Manipulate, Snap or other suggestions
(in response to Little Cthulhu)

We have a configuration matrix that defines what components goes into the assembly. This matrix have been converted into a DesignTable and from there we read the "Logical Name" and instantiate it from our ARM catalog. 

The interaction from the Engineer is to set the parameters e.g. Size, Flow, Pumptype etc. like you would do in a configurator. Then hit the "Update" parameter that triggers the script/EKL.

Besides that, we have another document to describe how the components are connected to each other. Everything work with constraints, but for some reason the Angle Constraints are not robust enough and occasionally fails. That's why i'm looking into the .Move and .SetComponent to position out components. 

The way we describe how components go together looks something like this: 

Part A, Connection 1, Part B, Connection 3, same/opposite, Rotation Angle

Yes the example i posted are for components that would be used in a Piping System, but we have so few "pipes" because the components are connected to each other. And the few pipes we make can be considered as a "normal" standard component. 

We use the same method to do configuration in context of the Main Assembly of our pumps. And for pumps we have thousands of geometrical variants. 

Right now we that this assembly configurator and have a macro to change the variant, save the assembly, render it in Blender. This process are fully automated..

Same can be said for simulation. We do that in Ansys for the pumps. A macro changes the configuration of the pump, save a CatProduct file and updates it in Ansys.. and with some simple scripts i can run in Batch mode. 

No.. it's not perfect and we have a lot of bugs... but we went from maybe one or two structural simulations a day too 100-150 a day. 

But you're right.. we have reinvented the wheel a couple of times.. but mostly to our benefit. :-) 

Little Cthulhu

RE: Help for VB - Constraining, Manipulate, Snap or other suggestions
(in response to Michael Laursen)

Thanks for describing your solution. Looks interesting.

 

What are your original inputs again? Part instance, axis vector to rotate it around and rotation angle?

Michael Laursen

RE: Help for VB - Constraining, Manipulate, Snap or other suggestions
(in response to Little Cthulhu)

Hi Cthulhu, 

Sorry for the delay... holidays came.. :-) And happy New Year.. :-)

The inputs: 
Part Instance A
Publication A ( AxisSystem )

PartInstance B 
Publication B ( AxisSystem ) 

If rotation needed, then Axis vector from Publication A (X, Y or Z axis from the axissystem) 
And the rotation Angle.

So to optimize my current solution to be more robust, especially for rotation.. I would like to use  axis system to axis System snap. and if needed rotate around a defined axis, most likely the Z axis. 

I know i should use the ".Move" object, i just don't quite understand the match so i can calculate the rotation and then the move from one axis system to another. 
I have watched so many youtube videos to an extent that i'm more confused now and not able to apply it to the ".Move" object.