Jump to content

Script 3D/2D Flatshot - Flatten


Jord_91

Recommended Posts

Hi,

    I'm looking to make a script, lisp or batch sort I could take all the 3D drawing from a file and convert it to a 2d drawing. I've tried a lot of thing like "flatshot", "outbounding", "flatten"... The best result was definitely with the "Flatshot" command, but it cannot be use as a script or lisp (I might be wrong). Outbounding wasn't effective at all. So I came ou with the Flatten Function from the Express tools that i run in the Wscript of Lee Mac. I made all a routine that goes like this :

_open *file* _-view _top -calque nouv 2D  _ai_selall _Flatten no _change tout  propriétés elév 0   tout  propriétés Couleur jaune  _change tout  propriétés ca 2D  _ai_selall _-overkill terminé PURGER TOUT * NON _AUDIT OUI _-VIEW _TOP _qsave _close

The fact is that the weight of the files are always too big and the details are not as accurate as "Flatshot". I could also add wblock to the script but it still a pretty heavy file 

 

So finally, I would need to take my 3D file to become a flat 2D drawing  on a specific layer and color (pretty simple to do). Here's an example of the furniture i would need to "transform" 3-MLE3060EFM.dwg, the flatshot finish Flatshot.dwg and the flatten script 3-MLE3060EFM.dwg.

 

Sorry for my bad english and just notice that the command are in french or internationnal.

Link to comment
Share on other sites

My original drawing was this one.

image.png.081d45d6baf285e8bdd38200c2fb2b7a.png

 

In fact, I would like to have the result of the Flatshot drawing without using the flatshot command as it's not possible to put it in a script or a lisp.

 

image.png.9c3cc554f972c0bbffd2be7b7a3530c2.png

 

I came out with this script sort of instead of only using the Flatten function trhat let me a drawing of over 1Mo I have a drawing of 105Ko what is really interesting but still not as acurate of the flashot command with a perfect 2D drawing and a lowet size of 39Ko.

_open *file* _filedia 0 _-view _top _-layer off QUINCAILLERIE-BLANC off QUINCAILLERIE-SN off QUINCAILLERIE-CHR  -Layer N 2D  _ai_selall  _AUDIT _yes _ai_selall 2FLAT 2flat _Flatten no _AUDIT _yes _change _all  _prop _layer 2D _co yellow  _ai_selall _-overkill _done _PURGE _all * n -purge r * n _AUDIT _yes _ai_selall _-overkill _done _PURGE _all * n _-purge r * n _AUDIT _yes _ai_selall _-overkill _done _PURGE _all * n _-purge r * n _-VIEW _TOP _filedia 1

Here is the 2Flat lisp I use in this script 2flat.lsp

 What's left for me is to ad a dot in each 4 corner of the drawing and to make a script to add the name of the dwg file in text attribute in the drawing (x,y,z) 0,-6,0...

 

It may sound complicated but at the end the result should look like this. So I need to take my 3D and make a 2D of the top view of it. Clear sort it's the Lighter possible (it's why I put it on only one layer called 2D. Finally I need to add the text attribute that coppy the name of the file in it.   

 image.png.bd2b1d8a94b529d2a67593944eb6a339.png

 

Thx guy's I appreciate that you take the time to look at my post.

Edited by Jord_91
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...