2 Replies Latest reply on Feb 2, 2018 6:56 AM by A. D.

    Automatic mate top planes

    A. D.

      Hello all,

       

      A great amount of my working activities with SW is about making floorplans etc. I do this in 3D with some pre-defined 'building blocks'/components i re-use most of the time.

       

      Now, i've got the logic to make all top planes at floor-height (and my floor height is equal with top plane of main-assembly), so when i insert (for example) a chair in my main assembly, this chair can be attached to my floor just by mating the top planes (of the chair and the main assembly) together.

       

      Now, what i'd like to be abled is to have a macro which enables me to do something like the following:

       

      (Within my main assembly: )

      1. Click macro button (TopMate or something)

      2. Select part

      3. Macro attaches/mates the top planes of the main assembly (activefile) and the selected component (whether a part or sub-assembly).

      4. Done.

       

      I've tried recording this, but couldn't figure it out.

       

      It doesn't seam like a really hard task for a VBA macro, can anyone of you help me writing this?

       

      Thanks in advance!

       

      A.

          • Re: Automatic mate top planes
            A. D.

            Yes, i'm familiar with that function, but, i'd like to do it based on purely the top planes with 'dumb' parts, as i get those parts delivered by external parties which won't be able to configure the requirements for the 'magnetic mates' functionality.

            They do, however, design all parts with the top plane in the right position.

            So for that reason i'd like to be able to do it based on just the top planes, with some kind of macro which automatically mates them.

             

            Unfortunately i'm not familiar enough to write the macro. What i currently think is that it should do something like this (but in the appropriate programming language offcourse) :

             

            Sub MateTopPlanes (ByVal SourceComponent)

             

            TargetTopPlane = Currentfile.TopPlane

            SourceTopPlane = SelectedComponent.TopPlane

            MateCoincident(TargetTopPlane, SourceTopPlane)

             

            End Sub

             

            Who could translate this to a working macro?

             

            Thanks in advance!

            A.