macro safe dxf, sat... in folder with property revision at the end

I would like to have this macro with the end _property „Revision“ from part.

For exemble 546_RevA . (part no 546)

Everything still in the folder \\ SAT-STEP-DXF-DWG

If possible, when Revision is nothing it should have nothing.

SolidworksImport export
Answers 15
DG
DG 2013-11-28 Best Answer

Do you need the keep folder name also like in the macro??

Also from where the revision info will be pulled i.e. drawing properties OR part/assembly properties?

FD
FD 2013-11-28

I would like it from the part and the drawing.

The folder should be same V2.-->like the macro.

DG
DG 2013-11-28

It can't be from both part or drawing as both value may not be same or macro will have to be coded to check either one first and then second to get the value.

So to keep the macro simple, please tell which one you need.

OR for part file it should read from part and from drawing it should read from drawing i.e. for SAT & STEP it would be from part and for DXF & DWG it would be from drawing.

FD
FD 2013-11-28

sorry, it must be from part:

DG
DG 2013-11-28

No problems. Also are you going to use the macro on Parts only??

FD
FD 2013-11-28

I safe always dxf and dwg from drawing and step, sat from parts.

FD
FD 2013-12-03

This costum property I would like to link at the end from file name-> Revision

comment imagecomment image
DG
DG 2013-12-03

Sorry for missing the thread earlier, please try/check the attached macro.

FD
FD 2013-12-03

Hello Deepak Gupta and thank you,

it works fine on parts. On drawings it works only with drawing.CustomInfo.

Is it possible to take the custom info from parts, when I make it from drawing?

I never have costum Infos in drawings.

thanks a lot

FD
FD 2013-12-04

Maybe it is not possible to read this information from a part in drawing with a macro?

DG
DG 2013-12-04

Here is the updated macro. Couldn't upload earlier as I had some connection issues here.

FD
FD 2013-12-04

amazing skill you have. Thank you very much. Very perfect  I like.

FP
FP 2014-01-02

This macro works very well and I have modified to only export the file types I needed but wonder what is involved to change it so if its a part it uses the part property "Revision" (eg for STEP files) otherwise if its a drawing it displays the drawing property "Revison"?

FD
FD 2014-01-03

I use only the Revision from the part. There is no information from the drawing. The drawing need a part wirth this property "Revision".

DG
DG 2014-01-03

Remove these lines from the macro

<p><strong>If swModel.GetType = swDocPART Then </strong></p><p></p><p><strong>Set swCustPrpMgr = swModel.Extension.CustomPropertyManager("")</strong></p><p><strong>swCustPrpMgr.Get3 "REVISION", False, "", Value </strong></p><p></p><p><strong>ElseIf swModel.GetType = swDocDRAWING Then</strong></p><p>    </p><p><strong>    Set swDraw = swModel</strong></p><p><strong>    Set swView = swDraw.GetFirstView</strong></p><p><strong>    Set swView = swView.GetNextView</strong></p><p><strong>    Set swDrawModel = swView.ReferencedDocument</strong></p><p><strong>    Set swCustPrpMgr = swDrawModel.Extension.CustomPropertyManager("")</strong></p><p><strong>    swCustPrpMgr.Get3 "REVISION", False, "", Value </strong></p><p></p><p><strong>End If</strong></p>

And replace with

<p><strong>Set swCustPrpMgr = swModel.Extension.CustomPropertyManager("")</strong></p><p><strong>swCustPrpMgr.Get3 "REVISION", False, "", Value</strong></p>

This will now let the macro to pull the revision information from the current active file.