Flat Pattern Export DXF - Add sketched PN

Programming and macros
bnc
Posts: 5
Joined: Tue Aug 10, 2021 11:10 am
Answers: 0
x 3

Flat Pattern Export DXF - Add sketched PN

Unread post by bnc »

I'm having trouble keying in on the method to accomplish my goal:

Automate exporting DXFs of flat patterns, but add a sketch to the flattened part with the partnumber and revision.

Currently I have a library annotation that we can drag and drop onto the model, but the revision isn't added unto the file goes through a release transition in PDM, so the annotation is always out of date, and makes the file dirty. Plus we have to remember to place the annotation.

I'd like to get access to the bounding-box sketch in the flat pattern folder (or add a new sketch to the flattened body), then programmically add my part number and revision note, then export the DXF.

Exporting the DXF is easy. I need help on the sketch part. Ideas?
User avatar
Jaylin Hochstetler
Posts: 387
Joined: Sat Mar 13, 2021 8:47 pm
Answers: 4
Location: Michigan
x 379
x 355
Contact:

Re: Flat Pattern Export DXF - Add sketched PN

Unread post by Jaylin Hochstetler »

Attached is a video of how I would do it.
A macro could be made to do this. I am not a macro guru so I won't be able to help you make one.
Attachments
Sketch Text.mp4
(17.32 MiB) Downloaded 116 times
A goal is only a wish until backed by a plan.
Austin Schukar
Posts: 98
Joined: Thu Mar 18, 2021 11:19 am
Answers: 1
Location: St. Louis, MO
x 288
x 56

Re: Flat Pattern Export DXF - Add sketched PN

Unread post by Austin Schukar »

So the revision note is not supposed to match the revision property, correct? Just increment up one value? Where is the PN/rev note going to be located?
Austin
User avatar
gupta9665
Posts: 388
Joined: Thu Mar 11, 2021 10:20 am
Answers: 20
Location: India
x 409
x 428

Re: Flat Pattern Export DXF - Add sketched PN

Unread post by gupta9665 »

Simple solution would be to set up a drawing template and add a note to that which is linked to model properties. Now use the API to export to DXF using that template and you are good to go :)
Deepak Gupta
SOLIDWORKS Consultant/Blogger
bnc
Posts: 5
Joined: Tue Aug 10, 2021 11:10 am
Answers: 0
x 3

Re: Flat Pattern Export DXF - Add sketched PN

Unread post by bnc »

Austin Schukar wrote: Thu Aug 12, 2021 10:12 am So the revision note is not supposed to match the revision property, correct? Just increment up one value? Where is the PN/rev note going to be located?
The note is made up from the item's part number ('NUMBER' in my case) and 'REVISION'. Before the PDM transition 'REVISION' property is set to a dash. It is set to a letter during the PDM transition.

I was planning on doing some rough calculation to place the text at the center of the part. Pretty hard to ensure it is fully on the part, but as long as its on the DXF, I think it'll be ok.
bnc
Posts: 5
Joined: Tue Aug 10, 2021 11:10 am
Answers: 0
x 3

Re: Flat Pattern Export DXF - Add sketched PN

Unread post by bnc »

gupta9665 wrote: Sun Aug 15, 2021 6:04 am Simple solution would be to set up a drawing template and add a note to that which is linked to model properties. Now use the API to export to DXF using that template and you are good to go :)
I'd rather not use a drawing. I do not want the title block, just model geometry and part number text.
User avatar
gupta9665
Posts: 388
Joined: Thu Mar 11, 2021 10:20 am
Answers: 20
Location: India
x 409
x 428

Re: Flat Pattern Export DXF - Add sketched PN

Unread post by gupta9665 »

bnc wrote: Mon Aug 16, 2021 7:20 am I'd rather not use a drawing. I do not want the title block, just model geometry and part number text.
You can remove the title block from the drawing and just keep a plan sheet with the note. Add the geometry and export.
Deepak Gupta
SOLIDWORKS Consultant/Blogger
User avatar
jcapriotti
Posts: 1810
Joined: Wed Mar 10, 2021 6:39 pm
Answers: 29
Location: The south
x 1158
x 1957

Re: Flat Pattern Export DXF - Add sketched PN

Unread post by jcapriotti »

gupta9665 wrote: Thu Aug 19, 2021 2:22 am You can remove the title block from the drawing and just keep a plan sheet with the note. Add the geometry and export.
This is what we do. We have an empty drawing with a sheet set to 4' x 8' (although the sheet size doesn't affect anything). Put your part flattened and scaled 1:1 on the sheet. You can add additional text as needed.

We also use this method for adding special form/punches to layers. We can suppress the form/punch in the flat configuration and extract it's sketch into the drawing with convert entities and place that on a layer needed by the CNC software.
Jason
Post Reply