cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

J-link save each sheet as a single file

amedina
1-Visitor

J-link save each sheet as a single file

I've been tasked to create a program that opens each multi page drawing and
creates a new set of drawings but this time single sheet.

12345.drw -> 12345sht1.drw + 12345sht2.drw + 13245sht3.drw

So I got some unknowns to figure out and some semi knowns.

Unknown-> how do I figure out if a view from another sheet has a detail in
the current sheet?
-> I assume that the view will go away when I delete the sheet where the
parent is, so the plan is to move that view to the current sheet off to the
side of the template (which I can probably figure out how to do)

Anyway, I would appreciate any clues.
4 REPLIES 4
amedina
1-Visitor
(To:amedina)

It seems that one can just get each view and set it to type general and
then I don't have to worry about the other sheets going away. Will try this
and see where it goes.


I don't have a clue about J-link (and I would like to start using it. If
you have any tutorials you want to share, or if you can tell me from where
I could start, I would very much appreciate it)
In your case, I would think the manual use:

1) create a temp under the working directory where 12345.drw is placed:
./temp
2) for i=1:number_of_sheets
save a copy of 12345.drw under ./temp with name 12345sht_{i}.drw
for j=1:number_of_sheets
open 12345sht_{i}.drw
If j<>i DELETE j_th sheet from 12345sht_{i}.drw
save 12345sht_{i}.drw
remove from memory 12345sht_{i}.drw
end for
end for
3) copy 12345sht_{1, 2, 3, ..., number_of_sheets}.drw files back to the
working directory
check that you are ok with files...

delete ./temp

regards,




-nk/.
amedina
1-Visitor
(To:amedina)

Nikos,

There is an API inside the install folder for pro/e. you will need to add
pfc.jar to your project in net beans so it recognizes internal pro/e java
commands. There is also a large PDF explaining the java api AKA jlink.
There is also TOOLkit for C which has more control.

NX has a lot more controls than pro/e does.


amedina
1-Visitor
(To:amedina)

Well, I've been beating this jlink horse for a few days now... Trying to
kill it and I think I might have had a dead horse to begin with.

I can't programatically set a view to "General". Jlink lets you create a
general or projection view only. It does not let you create anything else.
Similarly, you cannot change the view type. There is no Jlink option. So
then I got really clever and thought of running a mapkey to select each
view and set it to General. 1) Can't select a view in the same way as
pro/e right click, and 2) can't stop J-link, play the mapkey and then
resume Jlink. IE. Jlink will not allow you to run a mapkey while its
running, it will only stack the macros and run them after jlink has
stopped. You can't even prepare a mapkey that modifies "right view_3" for
example. Ctrl-F does not have views as an option of things to find.


Jlink is just very limited. Toolkit seems to be limited as well, not only
by the complexity of the license usage where a license is kept for 15
minutes and some other retarded PTC style limitations (as if anyone in
their right mind wants to compete by making pro/e better or maybe even make
money or make their software work), but also the same jlink limits:

"The function ProMacroLoad() loads a macro string or a mapkey
onto a stack of macros that are executed after control returns to
Pro/ENGINEER."

And in pro Toolkit there is also no drawing view type setting options. But
for who ever is interested in wasting their life times, there is some hope:

"To execute a macro from within Pro/TOOLKIT, call the function
ProMacroExecute(). The function runs the Pro/ENGINEER
macro and returns the control to the Pro/TOOLKIT application.
It executes the macros previously loaded using the function
ProMacroLoad(). The function works only in the synchronous
mode."

Anyway, At least I am able to delete a page using Jlink. This will
definetly mess up the views if there are child views. maybe It will fail
saying that there are child views or a parent view cannot be deleted where
child views exist in some other sheet. I will now go back to test this.
Hey maybe I get lucky and the child views are set to "general"
automatically.





Announcements


Top Tags