Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
Hi,
Can we use scripts to create geometries in PRO-E ?
say i need to create 10 identical cylinders of given diameter and length ... the task being to position them in space and with a particular orientation , so their position(center of the cylinder) and orientation with x axis are the parameters , i need to code ..
can we write a script for this with loops etc ??
thanks...
With J-link and / or the VB-api you most certainly can do this...
I have no experience with it however...
indeed, these API's will be your best option to achieve this.
VB API is in visual basic (use Visual Studio)
JLink is in Java ( I use Eclipse)
The difference is if you want to start your coded application from within ProE (use JLink) or from outside ProE (use VB)
Both API's are in the standard installation
Good luck!
You can actually perform this without using JLink or the Visual Basic API. If you have some imagination and knowledge of mapkeys, you can write this kind of thing in Perl or python. You could probably write a script driven by a webpage running Javascript. You could also probably do something like this with a DOS script.
The key is to distill the commands you need down into their simplest form and use one of those programming languages to create a script. Creo or Pro/E then executes that script as a Trail File. This, in turn, creates your geometry.
In the mid-1990's I wrote an incredibly complex series of perl scripts to perform all sorts of modeling tasks in Pro/E and that was way back in the "early days" of the software. You can certainly perform these same tasks faster and better using today's modern programming languages. You'll probably have a better shot using scripting languages other than the JLink, Weblink, or VB API's provided with Creo. Those can be tricky for novices. Scripting is pretty straightforward and it can be easier to get a simple script to execute than a more complex API-based solution.
Thanks!
-Brian