Copy link to clipboard
Copied
Hello,
I am having a problem. I want to draw several shapes and unite them as one shape through VBS, so there would be no borders inside them. The best thing I have manage to do is to ad paths via compoundPahtItems, but the problem is it only combine them together, it doesn't actually unite them.
could you help me out? and maybe post me a short example of such VBScript
thank you in advance!
Copy link to clipboard
Copied
You may have to use the doScript construct to run an Action that you have created to use the Pathfinder menu and Add to Shape. I'm on a Mac so don't have a lot of experience with VB scripts but I believe you can use the doScript to do what you want.
Copy link to clipboard
Copied
pathFinder commands are not available to scripting, as Larry said you have to record and action that unites your paths first, then call it from your vbs.
in this sample I named the action "pathFinderUnite", it is located in the "Set 2" actions folder. In your script, once you have selected all the paths you need to unite, call the action like this
iapp.DoScript "pathFinderUnite","Set 2"
iapp is my Illustrator variable
Copy link to clipboard
Copied
I have managed to unite them as I wanted, thank you very much!
I have one more question - how do I reference that new shape?
Copy link to clipboard
Copied
after uniting the paths, the resulting path is still selected, so you could use
myNewUnitedPath = iapp.ActiveDocument.Selection(0)
edit:
200 post!!! hurray!!
Copy link to clipboard
Copied
Thank you both Larry and Carlos,
I shall try that and let you know how it worked for me!
Copy link to clipboard
Copied
I have managed to unite them as I wanted, thank you very much!
I have one more question - how do I reference that new shape?
Find more inspiration, events, and resources on the new Adobe Community
Explore Now