Page 1 of 18 12311 ... LastLast
Results 1 to 20 of 343
  1. #1
    Member 1D_Inc's Avatar
    Join Date
    Mar 2012
    Location
    Russia
    Posts
    788

    Direct Autocad/Intellicad to Blender exporter. LISP to Download

    Latest update for CADs ========== v5.01 (04.11.2017)
    Latest update Nanocad attempt === v0.99Na (09.07.2014)

    Hello everyone, my name is Paul Kotelevets aka 1D_Inc, Im from Usinsk (Russia) and I'm rather new to Blender (1.5 year after 10 years of 3dsmax).
    Im an architect, engineer and kind a CG specialist, using a lot of CG software - from AutoCAD (+LISP+PGP) to Mypaint and Sculptris.
    I love Blender, as we all does. Sometimes, I donate more than just a single monthly Octane license fee - without any doubt, because it is goood software =)

    As a Blender user I realized, that there was absolutely no free easyway to export 2D linear data from Autocad to Blender 2.6x.
    For 2.49b, DXF importer is still the best solution, 3D for 2.6x now can be acquired

    • via FBX importer (doesnot test it yet, sorry)
    • via FBX format (autocad 2010-2013 -> Free FBX converter -> *.obj)
    • via _3DSOUT command, that is builded in AutoCAD (autocad 2000 - 2006)
    • or use 3DSOUT.arx, that you can download from autodesk site (autocad 2007-2009)


    But neither 3DS nor FBX supports 2D data.
    That was not fair and I was suffer.
    Last night I has got a cough, and start researching blender OBJ open file structure. Blender reads OBJ in other way as other programs does, so I (as LISP coder) found the way to generate an OBJ file, that Blender reads perfectly, directly from Autocad.

    Some pictures:










    Try it, check it, post comments.

    A short manual how to use this stuff:


    • Download Acad2Obj4Blender_v3.xx.zip from first post and unzip it.
    • Open AutoCAD with drawing, that contains objects you want to export.
    • Drag&Drop unzipped Acad2Obj4Blender_v3.xx.lsp into CAD window, or use _APPLOAD command to load it. CAD will say in commandline:
      >>Acad to Blender converter is loaded. Type 1D2B command to start.
    • Make a selection, enter obtained 1D2B command, press space up to 6 times, and conversion will start. If CAD lose focus (with no response), it is continuing working - it's ok.
      Enter 1D2OBJ command to import OBJ into ACAD for 3.xx versions.
    • When Notepad.exe will open created file - conversion is complete. Import created in opened dwg's directory *.obj file into Blender, and enjoy. If there are several OBJ file, import each of them. For example, 3 obj files = 3 imports to Blender.
    • If conversion were interrupted, press ESC and execute command, named 44, and object that cause error will be selected and zoomed. Explode it, and try again =)




    Some specifications of a beta code:
    • This is a pure AutoLISP script. Non-compiled text file, that usually works under any Autocad, Bricscad or ZWCAD, that supports LISP (not any AutoCAD LT - it doesnot) directly, not any install required.
    • It works with selection - only selected autocad primitives will be exported.
    • OBJ file is generated in directory of opened DWG. Every export adds unique OBJ file there.
    • Only Points, Lines, Circles, Arcs, Splines and 2D/3D Polylines, 3DFACES and 2dsolids are currently supported, with curve segments subdivide control. It was a hard night :-J
    • Layers structure is written as materials. Objects on same layer will get a same-named material in Blender with ability:
      • 0) Allocate objects as one complex 2D object per layer (joining them by autocad layer)
      • 1) Create objects as unique types (Lines, Polylines) by layer.
      • 2) Create objects as unique objects - as they were in DWG.

    • Pointclouds are supported with ability to read every nth point (to reduce density) - set up to 51 by default (result is on screenshot).
      As far as Blender could not read OBJ points (as meshlab can do ), but can read OBJ lines (as meshlab can't do ) all selected point will be connected with single point in Scene's origin (0,0,0) ,and collected into one single object. After deleting point in 0,0,0 - you'll get pointcloud.
    • Scaling is supported. By default it is set up to /1000. (mm in Autocad became m in Blender - this is better for Blender display system)
    • Exporter is set up for default blender OBJ import - no "X -Z Y -X"-like setups are required, need just to press import - obj - import, and apply rotation (crtl+A - Apply Rotation)
    • And yes, it is released for free.


    === Update 3.00

    1D2OBJ command allows (under some circumstance) to import Blender OBJ back into AutoCAD.
    Quads and Tris only, every face converts as separate 3D Face.
    Wire (Net) Mesh converts to acad Lines, Verticles - to Points.
    Materials are distributed as AutoCAD layers, with assigning random colors to them:

    === Update: 3.01

    1) new style MESH objects support (works fine for 2013 AutoCAD, doesnot work with 2009)
    Geomerty mode: 1= MESH, 2=lines, 3= points, 4= 3dfaces <2>:
    New MESH object has two main benefits: it is Ngon and _FLATSHOT compartible, so you can get Ngons, and get precise flat drawing (projection) of your model, that respects visibility and intersections.

    2) Now points are also distributed by generated layers.

    === Update 3.03

    Now it supports for UV importing, even if there were objects without UV.
    Also import mode was adopted to default Blender output (as 1D2B), which is:
    Forward: -Z Forward
    Up: Y Up

    === Update 3.05

    1) 3D-aligned Polylines with bulgency support
    2) X and Y shift values provided for far from origin drawings.
    _________________________

    Great thanks to DWG.ru (kpblc, VVA, Gromov,Alexander Rivilis, Evgeny Elpanov, and others), afralisp.net and, especially, to Lee Mac for sharing knowledges.
    Now continuing testing and developing this tool, see ya, and sorry for my bad Eng
    __________________________________________________ _______________________
    After loading that LISP into Autocad (for example, by simple drag&drop or _APPLOAD command), execute it
    by entering 1D2B
    command in commandline.

    updated to v 2.01 (12.10.2012) obsolete, export only, but fits to most of intellicads, download if latest gives problems.
    updated to v 3.03 (30.10.2013) import+export Blender OBJ ability (post #149)
    updated to v 3.05 (18.02.2014) freely aligned polylines with bulgency support (post #186)
    updated to v 3.07 (28.05.2015) 1DM command for exporting meshes, minor improvements (post #286)
    updated to v 4.00 (07.07.2015) Block as instances export ability+ architectural quad geometry generators.
    updated to v 4.02 (17.07.2015) Multiple object types support for 1DFEX and 1DBB commands
    updated to v4.05 (21.09.2015) Divide by zero, translit, closed contours and other fixes.
    updated to v5.00 (22.08.2017) Unified TEXT and ARC/SPLINE segmentation issues.
    updated to v5.01 (04.11.2017) = Unified export setup/preset system, text are not exported by default.
    Attached Files Attached Files
    Last edited by 1D_Inc; 04-Nov-17 at 12:50.



  2. #2
    Member camara's Avatar
    Join Date
    Sep 2008
    Location
    Portugal
    Posts
    78
    Thatīs amazing! That will be a very useful tool for Blender to penetrate more in the ArchViz business.
    Keep posting the progress.



  3. #3
    Member 1D_Inc's Avatar
    Join Date
    Mar 2012
    Location
    Russia
    Posts
    788
    Thank you!

    And finally...

    ____________v2.00 multyplatform test version.
    Tested on AutoCAD 2009, ZWCAD 2012 and BRICSCAD v12 (win 7 x64)
    (ZWCAD's conversion speed is much slower, than other's, due to its ActeveX API support)
    Supports for everything, that I'v been able to got=)
    3DFACE object's support has been added. So, If you will explode Polyface Mesh or Polygon Mesh objects, you will be able to export them to Blender. 3DFACE objects are collected separately+bylayer to escape Blender's imported geometry display trouble.
    On every ~1.7 Mb proceeded, v2.00 attempts to save OBJ file (if you'll convert a large selection, a several files will be created). That makes better perfomance and stability.
    On every 200th object proceeded it prints progress percentage in cmdline for BRICSCAD and ZWCAD.
    If conversion's mistake will took its place, then


    • 44 command will select last proceeded object, that causes error.
    • 99 command will select everythin already proceeded to avoid export duplication (now testing).
    • 33 command will select objects, that doesnot passed internal test, and were not converted. If conversion was succesfull, it will be executed automatically.



    Delaunay triangulation script for point cloud I has got from there:
    http://blenderartists.org/forum/show...oronoi-diagram

    Some wireframe render with extrude:
    Wireframe render setup plugin I has got from there
    http://blenderartists.org/forum/show...-a-wire-render
    Attached Images Attached Images
    Last edited by 1D_Inc; 16-Jan-14 at 00:11.



  4. #4
    Member McBuff's Avatar
    Join Date
    Nov 2011
    Location
    Hoogstraten, Belgium
    Posts
    464
    Hey good luck with your project, I'm looking forward to using it in the future
    And your English is good enough for us to understand.
    "Put Smarties tubes on cats legs make them walk like a robot"
    -Jimmy Carr



  5. #5
    Member 1D_Inc's Avatar
    Join Date
    Mar 2012
    Location
    Russia
    Posts
    788
    Well, there is fast progress inthere

    BlenderNation News

    Another side: Blender DXF reading
    Last edited by 1D_Inc; 10-Jan-14 at 11:50.



  6. #6
    Member ejnaren's Avatar
    Join Date
    Nov 2009
    Location
    Denmark
    Posts
    740
    Wow... Very well done.
    I have long wanted to work on better integration between autodesk products and blender.
    It is nice to see other architects being more techy and starting to break down the barriers as well.



  7. #7
    Member 1D_Inc's Avatar
    Join Date
    Mar 2012
    Location
    Russia
    Posts
    788
    Splines, arcs and circles will be converted as segmented objects, with ability to set number of divisions. Circles, arcs will be divided to given numer of segments, spline's sudivision will be doubled.
    It will be done through AutoCAD ActiveX API.
    Last edited by 1D_Inc; 02-Oct-12 at 10:33.



  8. #8
    Member 1D_Inc's Avatar
    Join Date
    Mar 2012
    Location
    Russia
    Posts
    788
    Well, It is attached down to the first post. Take it, Test it, Taste it, Love it as I already do
    And leave comments if it were useful to you.
    Tested on win7 x64 Acad 2009ru + Blender 2.63RC1
    Attached Images Attached Images
    Last edited by 1D_Inc; 02-Oct-12 at 14:02.



  9. #9
    Member
    Join Date
    Jan 2012
    Location
    Portugal
    Posts
    60
    Hi,
    Sincere thanks for the work.
    I use dxf import script!
    Your script does not work on bricscad.
    Bricscad is much cheaper and does the same as autocad.

    Is it posible to support inteli cad based apps?



  10. #10
    Member 1D_Inc's Avatar
    Join Date
    Mar 2012
    Location
    Russia
    Posts
    788
    Sorry, but maybe later, they have too different APIs, and it is too hard to write on LISP for intellicads.
    About DXF import script - it was REALLY HARD to get suitable result from it for me, as far as it doesnot provide any way for at least layers conversions =\
    I can control a lot of parameters via LISP - from objects distribution to even output precision (for example, to reduce file weigth) and Pclouds/curves Density (Importer makes too dense splines, you know).

    Btw I know Lispers, who write for ZWCAD, they damn it, but continuing coding =\
    Usually, they had come to intellicad from AutoCAD programming, and I don't think, that they will agree to rewrite this code. At least, under GPL =)

    But yes, intellicad-based software is much much cheaper...
    Last edited by 1D_Inc; 05-Oct-12 at 08:04.



  11. #11
    Wow thanks for this. I only tried DXF import but it had several problems which could be solved but it took time to prepare. I'll test this in the next days and I'll let you know my experience. But it looks really cool. I do usually model from 2d drawings because it's the quickest way (but I used this in 3ds max) so now I can really move fully to blender



  12. #12
    Member 1D_Inc's Avatar
    Join Date
    Mar 2012
    Location
    Russia
    Posts
    788
    I hope it will be helpful =)
    What about me - in linear modelling I prefere autocad as itself. But because - you understand - I'm Lisp coder.
    It was rather hard to rewrite most of Autocad's modelling tools and navigation, to get suitable tool, but now it makes sence.


    http://www.youtube.com/watch?v=6UOnE...layer_embedded
    Last edited by 1D_Inc; 02-Oct-12 at 23:34.



  13. #13
    Member AlexDS's Avatar
    Join Date
    Aug 2010
    Location
    Romania (EU)
    Posts
    444
    keep up the good work
    see my portfolio
    my system: Win 10; intel i5 750, 12 GB DDRAM3 , Geforce GTS 250



  14. #14
    Member 1D_Inc's Avatar
    Join Date
    Mar 2012
    Location
    Russia
    Posts
    788
    Thanks =)
    Well, I guess here is time for some tutorial. Import parameters:
    Object Distribution (LM parameter) has range [0-2] .If you will set it to

    0 - Objects will be joined byLayer. - second picture.

    1 - Objects will be joined by same type and layer (third picture), for example - all splines on layer Defpoints will be joined into one mesh, but you can everytime select all objects that were on same layer, if you will make selection by linked material (shift+L - Material) - fifth picture.

    2 - Every entity will be separate (forth picture), but you can everytime select all objects that were on same layer, if you... - fifth picture .

    As you can see, PointCloud is generated as separate object, independently from layer or LM setting, and contain all points you've selected. It's density depends on NT parameter.
    NT=51 is default and it allow to write every 51nth point from all selected - on second picture.
    NT=10 is for every 10th, and shown at third picture.
    NT=1 is for every point to proceed, forth picture.



    1D2B_LM and NT2.png

    LM = 3x.png

    Now, as you can see, all points of Pointcloud are connected to one, in 0,0,0.
    Just select it, delete - and you will get your clean pointcloud:

    ppx.png
    Last edited by 1D_Inc; 02-Oct-12 at 22:30.



  15. #15
    Member 1D_Inc's Avatar
    Join Date
    Mar 2012
    Location
    Russia
    Posts
    788
    So, it seems that default DXF importer, like mine, doesnot write polyline's bulges (polyline's arc segments).
    Well, I made some tests, and I think that we gonna altogether pass it through. =)

    About precision: it will be a separate parameter to control output format's precision.
    To compare: Obj with precision = 8 is larger, than Obj with precision = 0, more than twice.
    (8~100%, 1~59%, 0~47%)

    precision.png

    UPD: And, well, bulged polyline's support will be included on next release.

    Bulge.png
    Last edited by 1D_Inc; 02-Oct-12 at 23:35.



  16. #16
    I'm always getting this error: no function definition: VLAX-ENAME->VLA-OBJECT and I cannot export anything. What am I doing wrong?



  17. #17
    I'm trying to use it with AutoCAD LT but LT doesn't permit to use LISP scripts so I tried to copy&paste your script as macro assigned to a button but when I press it seems it doesn't work.



  18. #18
    Member 1D_Inc's Avatar
    Join Date
    Mar 2012
    Location
    Russia
    Posts
    788
    Originally Posted by cdog View Post
    I'm always getting this error: no function definition: VLAX-ENAME->VLA-OBJECT and I cannot export anything. What am I doing wrong?
    Sorry, it is need to initialize some library. It is simlpe, but I always forget to provide it:
    Type in commandline (vl-load-com) before first function start.
    I fixed it since release v1.01, no (vl-load-com) is required more, thanks for the feedback!
    Last edited by 1D_Inc; 04-Oct-12 at 14:07.



  19. #19
    Member 1D_Inc's Avatar
    Join Date
    Mar 2012
    Location
    Russia
    Posts
    788
    AutoCAD LT is cheaper, than vanilla AutoCAD ten times.
    Why is it so? It's simple - LT doesnot allows any forcing of a naked AutoCAD core via LISP, DCL, ActiveX, VBA, dotNET or ObjectARX.
    That was the main goal of Autodesk - to doesnot allow to you to use in LT any mentionable modifications.

    But yes, It is much, much cheaper...
    Last edited by 1D_Inc; 04-Oct-12 at 09:06.



  20. #20
    Member 1D_Inc's Avatar
    Join Date
    Mar 2012
    Location
    Russia
    Posts
    788
    Script is updated to v1.01!

    Now precision parameter and basic bulged polylines support were provided!
    Known issue - if bulged polyline is not parallel to world's XY - it stops exporting (yet)
    But if you doesnot have such thing - you can test bulged polylines support.

    previous version (stable, without bulge and precision)
    Attached Files Attached Files
    Last edited by 1D_Inc; 03-Oct-12 at 13:36.



Page 1 of 18 12311 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •