Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Attempting to make macro for dwg, stp and pdf export for all drawings in assembly

Status
Not open for further replies.

Julian_Fascio

Industrial
Jul 7, 2022
1
0
0
US
Hello,



I have a macro that I have started, in essence, what I would like it to do is open every drawing in an assembly, export a pdf and dwg from a drawing and export an stp of the actual part to selected folders. It is currently not giving me any compiling errors however when I run it nothing happens. What am I doing wrong here? Also can you please advise on a method to make it go through all parts in an assembly and export all drawing sheets to pdf instead of sheet 1?

 
 https://files.engineering.com/getfile.aspx?folder=84f29712-ff87-4254-90a1-46e6cc00a137&file=journal.vb
Replies continue below

Recommended for you

My overall advice:
Start with the requirements and desired workflow (looks like you have a good start here).
Look at some sample data. In your case, it sounds like you want to start with an assembly file. Is the drawing data located within the component part files, or are the drawing files separate (master model), maybe a mix of both?
Break the problem into manageable chunks. For example, start with the STEP export - record a journal (or find existing code that does close to what you want). Edit it to work with any given file. Refactor the code into subroutines or functions so that you can call them from Sub Main (this will be important later when you want to step through all the parts in the assembly).
Repeat the process for DWG and PDF export.
Combine the code into a single journal so you get all 3 output files.
Add code to process the entire assembly. Get information from each component and call your functions as needed.

Here's a few links that might help:


www.nxjournaling.com
 
Status
Not open for further replies.
Back
Top