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

export flat assembly

Newbie

export flat assembly


I'm wondering if there is a known way to export a flat assembly. I have
a theory that I can export a multilevel assembly to step then open the
step and rename all the objects back the original part names and then
save the assembly and place it where the original parts are. Then I can
re open it with the original parts. So I think. I mean I don't have a
clue just yet, I'm trying to do it at the moment. But if anyone has done
this type of thing before, I would love to know how in the world you do
it.



Thanks



Alfonso


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
4 REPLIES 4

export flat assembly

OK I give in. There is officially no need for flattening the model tree
from a full bill of materials to a single level asm. Except that I do
seem to want to do this for some reason. There was a guy out there who
actually paid a company for a similar solution. Other than that, people
keep asking why.



One reason is to quickly re organize an assembly structure to better
function in a manufacturing environment. Some times the way assemblies
are broken down is not to the liking of everyone. Today PTC has solved
the problem for you. For every single part in the thousands just go edit
restructure, and then click the assembly you want to shove this part
into and then pray that you are following the parent child relationships
correctly. A thousand times over. Or why not just flatten the assembly
make a bunch of copies and then assemble by default. Go to each assembly
and take away what you don't like and eventually you get a nice
structure that works for every one. That week. In one day. Or two. As
opposed to three or four years.



Alfonso


export flat assembly

Response to a community posting in September of 2008.
----------
Hey Alfonso,

In September you posted to the user community for suggestions about how to create a flat model structure from an assembly structure. I have been working on a similar need. I have explored a few ideas using File --> 'Save As' and have included my findings below.

Using 'Save As' methods to produce flat assembly structures:
IGES - use the flat option in the file structure drop-down
Notes: A part file for the assembly is appended to the structure as the last file

Parasolid, the default file structure is flat.
Notes: The file reads seem to be a bit slow for complex parts.


As these methods work with some exception, I am interested to know if you or anyone else has anything more on the topic.


Best wishes,
Jered

WF3 M140


export flat assembly

For that particular time, I ended up having a pre-made map key that
fixes parts and then restructures them. I really found no other way to
programmatically find the "next" part other than first export the
current model tree.



So the procedure is to export the model tree. Then I use perl to make
some map key for that particular assembly. The map key gets made and
then imported to pro/e. Then you just run the map key and watch pro/e go
for a little while. It is useful, but realize that this is not exactly a
silver bullet. Often times the process get's stuck and you have to hit
freeze a couple of times (or a thousand). The logic is not that complex.
The script finds items on the "treetool.txt" that are .asm and .prt then
arranges to restructure all .prt items to the main .asm item. I suppose
one could add exceptions to the tool. Unfortunatelly, I don't have the
code right now. Here is one that does something similar. This one runs a
map key that makes a step file or something as such for in imput list.
It is not similar in what you actually want, but it is similar in how
you are supposed to make a map key from a list of parts. I hope it is
useful



#! /usr/bin/perl -w

use warnings;

use strict; # Always!



#use LWP:Smiley Very Happyebug qw(+);

########################################################################
######



our $inputlist = "batchinput.txt";

our $outputlist = "batchoutput.pro";

our $i=01;



open(FILE,"$inputlist") or die "Cannot open input file '$inputlist' be
sure you have created it in your folder where this script is at; error
given: $!";

my @lines = <file>;

close(FILE);

chomp(@lines);



open(FILE,">$outputlist") or die "Cannot open input file '$inputlist' be
sure you have created it in your folder where this script is at; error
given: $!";



foreach my $part (@lines) {

print FILE "mapkey \/$i \@MAPKEY_NAMEopens
$part\;\@MAPKEY\_LABEL\/open\;\\n";

print FILE "mapkey\(continued\) \~ Activate \`main\_dlg\_cur`\
\`ProCmdModelOpen\.file\`\;\\n";

print FILE "mapkey\(continued\) \~ Input \`file\_open\` \`Inputname\`
\`$part\`\;\\n";

print FILE "mapkey\(continued\) \~ Update \`file\_open\` \`Inputname\`
\`$part\`\;\~ Activate \`file\_open\` \`Open\`\;\\n";

print FILE "mapkey\(continued\) \%\/stp\;\\n";

print FILE "mapkey\(continued\) \~ Activate \`UI Message Dialog\`
\`ok\`\;\\n";

print FILE "mapkey\(continued\) \~ Activate \`intf_export\`
\`OkPushBtn\`\;\\n";

print FILE "mapkey\(continued\) \~ Select \`main_dlg_cur\` \`MenuBar1\`1
\`Windows\`\;\\n";

print FILE "mapkey\(continued\) \~ Close \`main\_dlg\_cur\`
\`MenuBar1\`\;\\n";

print FILE "mapkey\(continued\) \~ Activate \`main\_dlg\_cur\`
\`Windows\.psh\_win\_close\`\;\n";



$i++;

}

print FILE "mapkey imp \\n";

$i=01;

foreach my $part (@lines) {

print FILE "mapkey(continued) \%\/$i\;\\n";

$i++;

}

print FILE "mapkey(continued);\n";

close(FILE);





Regards.



Alfonso



Alfonso Medina O.
Mechanical Engineer

export flat assembly

About a decade ago I helped write a series of mapkeys which would do this
same kind of thing. It would load a mapkey configuration which hid all
features and expanded all subassemblies, export the model tree, and then
using some windows batch file code sort the text in order and remove all
duplicates (to prevent excess work) then open every part adn assembly and
delete all existing layers (except for specific layer names protected by
the user) and create all new layers according to the current standard. The
mapkey would then work through the model placing everything onto the
proper layer. This was compounded in difficulty by the fact that there
were different layer standards between parts and assemblies, and the
assembly rules included the file name in the layer name to get around the
old recursive layer blanking issues.

And then PTC did the v20 interface update and busted everything. I chased
upgrades with it for several years and even re-wrote into C with a GUI
interface before everything was moved into ModelCheck. We adapted the same
process to create Copy Geom features back before Shrinkwrap was available.
I wonder how many other people have had to do this kind of thing.

Thanks for bringing back bad memories.

Jarrod Miller
Manufacturing Project Specialist
Americas Operations Division - Decatur, IL
Caterpillar Inc.
Phone (217) 475-4514
Fax (217) 475-6848




"Alfonso Medina" <->
03/16/2009 12:42 PM
Please respond to
"Alfonso Medina" <->


To
Jered Larsen <->
cc
-
Subject
[proecad] - RE: export flat assembly




Caterpillar: Confidential Green Retain Until: 04/15/2009



For that particular time, I ended up having a pre-made map key that fixes
parts and then restructures them. I really found no other way to
programmatically find the “next” part other than first export the current
model tree.

So the procedure is to export the model tree. Then I use perl to make some
map key for that particular assembly. The map key gets made and then
imported to pro/e. Then you just run the map key and watch pro/e go for a
little while. It is useful, but realize that this is not exactly a silver
bullet. Often times the process get’s stuck and you have to hit freeze a
couple of times (or a thousand). The logic is not that complex. The script
finds items on the “treetool.txt” that are .asm and .prt then arranges to
restructure all .prt items to the main .asm item. I suppose one could add
exceptions to the tool. Unfortunatelly, I don’t have the code right now.
Here is one that does something similar. This one runs a map key that
makes a step file or something as such for in imput list. It is not
similar in what you actually want, but it is similar in how you are
supposed to make a map key from a list of parts. I hope it is useful

#! /usr/bin/perl -w
use warnings;
use strict; # Always!

#use LWP:Smiley Very Happyebug qw(+);
##############################################################################

our $inputlist = "batchinput.txt";
our $outputlist = "batchoutput.pro";
our $i=01;

open(FILE,"$inputlist") or die "Cannot open input file '$inputlist' be
sure you have created it in your folder where this script is at; error
given: $!";
my @lines = <file>;
close(FILE);
chomp(@lines);

open(FILE,">$outputlist") or die "Cannot open input file '$inputlist' be
sure you have created it in your folder where this script is at; error
given: $!";

foreach my $part (@lines) {
print FILE "mapkey \/$i \@MAPKEY_NAMEopens
$part\;\@MAPKEY\_LABEL\/open\;\\n";
print FILE "mapkey\(continued\) \~ Activate \`main\_dlg\_cur`\
\`ProCmdModelOpen\.file\`\;\\n";
print FILE "mapkey\(continued\) \~ Input \`file\_open\` \`Inputname\`
\`$part\`\;\\n";
print FILE "mapkey\(continued\) \~ Update \`file\_open\` \`Inputname\`
\`$part\`\;\~ Activate \`file\_open\` \`Open\`\;\\n";
print FILE "mapkey\(continued\) \%\/stp\;\\n";
print FILE "mapkey\(continued\) \~ Activate \`UI Message Dialog\`
\`ok\`\;\\n";
print FILE "mapkey\(continued\) \~ Activate \`intf_export\`
\`OkPushBtn\`\;\\n";
print FILE "mapkey\(continued\) \~ Select \`main_dlg_cur\` \`MenuBar1\`1
\`Windows\`\;\\n";
print FILE "mapkey\(continued\) \~ Close \`main\_dlg\_cur\`
\`MenuBar1\`\;\\n";
print FILE "mapkey\(continued\) \~ Activate \`main\_dlg\_cur\`
\`Windows\.psh\_win\_close\`\;\n";

$i++;
}
print FILE "mapkey imp \\n";
$i=01;
foreach my $part (@lines) {
print FILE "mapkey(continued) \%\/$i\;\\n";
$i++;
}
print FILE "mapkey(continued);\n";
close(FILE);


Regards.

Alfonso




Alfonso Medina O.
Mechanical Engineer

-
Announcements