Copy Surface Macro

So…
There had been some macro idea in my personal backlog for quite some times and I finally have some times to start working on them recently…

Before i start working on the macro from scratch, I thought i should ask around here first whether is there an existing macro that i can reuse…

1. Copy Surface macro
So.. i am kind of annoyed with the amount of mouse click i need to copy a surface (entering 0 as value, and then accept), I will be great if i can just copy all the selected surface with 1 click/key without going into the interface…

The macro should:
i. Offset all selected surface by 0 (User will select the surface before clicking the macro)
ii. (Optional) Apply a preset color to the copied surfaces

Hi Zhen-Wei Tee

you also could achieve this by using “knit surface”
there is an API example in the help files:
“Create Surface Knit Feature Example”
https://help.solidworks.com/2016/english/api/sldworksapi/create_surface_knit_feature_example_vb6.htm

An advantage here can be that you can merge the resulting surfaces

Eddy

There are already 3 functions that copy surfaces:

  1. move copy bodies - for solid/surface bodies
  2. knit, as mentioned by Eddy Alleman
  3. offset (at 0 distance).

Move bodies only works if you don’t have it set to using mates.
Knit won’t work for a single face

If your macro gets around these and can be initiated with a hotkey, that would be cool.

This thread might give you a head-start:

https://forum.solidworks.com/thread/219694

Hi @Zhen-Wei Tee

I just uploaded a VBA macro to Codestack that does what you asked:

https://github.com/EddyAlleman/codestack/tree/master/solidworks-api/geometry/surface-offset-equal

It could take some days before you can find it on the Codestack website. This way you can look into it already.

Happy coding!

Eddy

Sorry for the late reply, the last few days was really busy for me
I had tested out the marco and it was really FANTASTIC
It even include the number of faces being copied in the feature which is really nice :slight_smile:

Thanks alot!

You´re welcome.
Glad you like it !
The macro has been published on Codestack today.
Go to Goodies > Geometry > copy surfaces
image.png
direct link:
https://www.codestack.net/solidworks-api/geometry/surface-offset-equal/

Eddy