Creating a macro that converts files to a drawing and dxf

Hello, I'd like to know if you could help me. because I have several steps that are repetitive that's why I would like to have your help for a macro that could do it automatically.

I have several iges, these iges are parts (surfaces) of different sizes and shapes, there can be bend parts

My job is to position them, to unfold if the part and fold and also to have all these parts in view of the faces. Then I have to add a thickness on these parts.

When recording I would need the front view of the room and the left view if possible to have these two views in the same plane.

 

Thank you in advance for your help

 

 

Lucie

Hello

I have a macro that converts the already existing drawings into DXF but after creating the drawings with predefined views I don't know...


macro_dxf.swp

if you ever want to I also have one that converts to PDF


macro_pdf.swp

Hello manu67,

Thanks for help but I would need the opposite of your macro, that is to say that from an IGES I have to create a drawing and then that this drawing (defined front plane and left view at the same time) be converted into DXF.

Thank you 

Hello

 

This seems to me to be quite difficult to achieve. Indeed, as you explain yourself, your pieces are of different sizes and shapes... and even of different designs (bent or unbent sheets, machined part, etc etc). In short, nothing that could not allow a stupid and unthoughtful automatism.

 

And then, from a more concrete point of view, I don't really see how to tell the macro which view is the front one and which is the left one in your IGES (since nothing seems to be "standard")

2 Likes

Hello

The best solution, but one that will never be perfect, is:

    - Use predefined views:

    http://help.solidworks.com/2012/French/SolidWorks/sldworks/Predefined_Views.htm?id=0eddaeb961914f718ea0995c2d184640

    - Then we insert for example 4 views, and we delete the ones that don't fit! This already saves a lot of time. And if the configuration is not the right one, you can change it by right-clicking on the first view (= the parent view, and it changes all the other views = the child views, for example to put the configuration unfolded).

    - Then, we insert the objects of the model (or the dimensions by hand if it doesn't work):

http://help.solidworks.com/2012/french/solidworks/sldworks/inserting_model_items.htm

    - Finally, we use a macro (the one proposed above for example), to create the DXF.

1 Like

Hello coin37coin, and .PL

Thank you for your answer; I attach a file like this it will be much simpler and you will understand my problem better. So  in this file I attach an iges and also a dxf this dxf represents the last step I need to have after creating a macro. For your information , these files are always in iges and these files are surfaces. So I have to rotate them 90 degrees, then put a thickness and create a front and left view see final view. (attached DXF). (The front view will be used for laser cutting and the left view as a means of inspection after bending the workpiece). (the pieces change size and shape but it won't change anything for the positioning I think)

To save time, I would like to have a macro that can do these steps in one click. Is it feasible?

Thank you in advance.

 


6611_x.igs

And here's the view that I need to have after using the macro.

See attached DXF

Regards


6611_x-vue_final.dxf

Re

If it's ALWAYS and EXACTLY the same manipulations, then it's doable, but I'd be very surprised.

What we can do is a macro by learning: 

http://help.solidworks.com/2013/French/SolidWorks/sldworks/c_recording_playing_macros.htm

Be careful, it is better to avoid using the mouse, otherwise the result will be random!

So try to do everything on the keyboard.

At worst, do your macro step by step: you will have to launch a first macro (why not with a keyboard shortcut), click with your mouse on a face, launch your second macro, etc...

 

1 Like

In fact, you're looking to automate the work of a cartoonist if I understand correctly?

 

That said, I still think it's impossible. Too many parameters fluctuating.

 

But if it works, as @.PL. It has to be exactly the same from one file to another. Which seems unlikely to me, if only for the grip of the thickness or the number of folds to be taken into account

2 Likes

Thank you for your feedback @PL and coin37coin, 

That's exactly what coin37 coin is all about. 

Otherwise yes @PL it's always and exactly the same manipulations. 

Would it be possible that you could help me make this macro, because I don't know anything about it!

In any case, I'd like to try, you never know. 

Thank you 

Regards 

Hello

I can help you do your macro. I don't have a lot of time but if you have it, it should be managed.

Contact me in PM and send me a piece of code if you have. If we get something done (or if we need support) we'll post here.

1 Like

Hello

I read the messages quickly and I would just like to add 2 things if it can help you:

If you have myCADtools, the "SmartDrawings" is very useful for making a lot of plans with the same predefined views. From a list of parts/assembly he creates all the drawings according to a model (front view, right view etc...).

For macros, the easiest thing to do when you're starting out is to record one and modify it as needed.

Good luck...