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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

how to give a name of exported dxf files automatically according to parameters

thlavinka
7-Bedrock

how to give a name of exported dxf files automatically according to parameters

hello,

 

I would need a help with autoranaming exported dxf files according to two parameters.

The first part of the name would be name of the top level assembly (for ex.473-4445) and the second one a local parameter of the exported part (for ex. P1)

The full name of the exported dxf would be 473-4445_P1

 

Thanks for help in advance

 

T.


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.
ACCEPTED SOLUTION

Accepted Solutions

Tomas,

e:\users\hlavinkat\creo\config.pro must contain: bom_format E:\users\hlavinkat\creo\mybom.fmt

I made a mistake in previous Reply.

Because DESKA_ORBIT_ drawing is placed on sheet inside 473-4439.drw (assembly drawing), there is no simple method how to fulfil your request.

Automation would be possible, if separate DESKA_ORBIT_.drw exists for DESKA_ORBIT_.prt.

So we can "close" this Discussion.

Martin Hanak


Martin Hanák

View solution in original post

10 REPLIES 10

Tomas,

to be able to automate some activity, you have to be able to describe how do you do that activity manually.

In you case:

> How do you get assembly name ?

> How do you get parameter value ?

If you know the above information, you can use AutoIt/AutoHotkey to record manual steps.

Martin Hanak


Martin Hanák

assembly name is a model name of top level assembly (pic1)

the parameter value is actually a bouble number made by integer and some extra symbols added (pic2, paremeter DXF_NAME)

the name of exported dxf should be 473-4439_P1 in this case

1.jpg

2.jpg

Tomas,

my guess about what you want to do is that:

  1. you want to open an assembly, for example 473-4439
  2. you want to export something to DXF format, for example DESKA_ORBIT_ part

Question: Which objects do you want to export ? Are you sure that they contain DXF_NAME parameter ?

Top assembly ?

All subassemblies ?

All parts ?

Question: Do you want to export 3D models into 3D DXF or their drawings into 2D DXF ?

Martin Hanak


Martin Hanák

ad 1. - yes

ad 2 - I want to export all parts of the assembly 473-4439 which are made from a metal sheet (for laser cutting CNC machine). The parameter DXF_NAME is in start_part_solid_prt template so I need to export only that prts starting with "PL" in parameter ROZMER.

the export format would be 2D DXF

Tomas,

this means:

  1. you open an assembly, for example 473-4439
  2. you need to get list of parts, which meet the condition ROZMER="PL*"

Tip:

Create mybom.fmt containing 2 following lines:

.breakdown

.row %$name;%ROZMER;%DXF_NAME

Put the following option into config.pro file:

bom_format PATH_TO_DIRECTORY\mybom.fmt

Open the assembly, activate Model tab and click Bill of Materials from Investigate group.

Creo creates text file 473-4439.bom.1

You can open this file in Excel or Notepad and filter parts, which meet the condition ROZMER="PL*"

So you have the list of parts.

Questions:

How do you find parts and their drawings ?

Is drawing name same as part name ?

Are drawings and parts located in the same directory as top assembly ?

Martin Hanak


Martin Hanák

Martin, I exported the 473-4439.bom.1, opened it and saw it looks like this: "1 Part DESKA_ORBIT_". It means number of parts in assembly and a model name.

I quess there is a problem with the fmt file path - am i right? I put the fmt in working directory and in the folder where is the config.pro

everything (assembly, parts,drawings) is saved in the same directory called 473-4439.

all those drawings are in one drawing (called 473-4439.drw) containing top level assembly, subassemblies and prts in several shhets.

Tomas,

on my PC:

  • my working directory is set to ... D:\tmp\creo
  • Creo 2.0 startup directory is ... D:\tmp\creo
  • D:\tmp\creo\config.pro contains the option

bom_format bom_format D:\tmp\creo\mybom.fmt

  • bom_format D:\tmp\creo\mybom.fmt contains following lines

.breakdown

.row %$name;%ROZMER;%DXF_NAME

If I understand you well 473-4439.drw is the only one drawing in 473-4439 directory (multisheet, multimodel). Is it true ?

Is DESKA_ORBIT_ drawing included in 473-4439.drw (this means that specific sheet of 473-4439.drw contains DESKA_ORBIT_ drawing) ?

Martin Hanak


Martin Hanák

working directory: c:\users\hlavinkat\Documents\473-4439\22 - kopie

Startup Directory: e:\users\hlavinkat\creo\

e:\users\hlavinkat\creo\config.pro contains: bom_format bom_format E:\users\hlavinkat\creo\mybom.fmt

mybom.fmt in e:\users\hlavinkat\creo\ contains:

.breakdown

.row %$name;%ROZMER;%DXF_NAME

the second part of your answer - yes its true

Tomas,

e:\users\hlavinkat\creo\config.pro must contain: bom_format E:\users\hlavinkat\creo\mybom.fmt

I made a mistake in previous Reply.

Because DESKA_ORBIT_ drawing is placed on sheet inside 473-4439.drw (assembly drawing), there is no simple method how to fulfil your request.

Automation would be possible, if separate DESKA_ORBIT_.drw exists for DESKA_ORBIT_.prt.

So we can "close" this Discussion.

Martin Hanak


Martin Hanák

OK, thanks for your help

Announcements
NEW Creo+ Topics: Real-time Collaboration


Top Tags