Menu

#56 Export CAD to SH3D

open
nobody
1
2025-09-15
2025-04-04
xlance
No

Hello
A two step method to convert lines from Autocad to walls in Sweethome3d

Load and Run"cad2walls.lsp" in Autocad >
Select objects >
Use ccw (counterclockwise reading of points | default )

Will generate "cad2walls.Input.txt" >
Put "cad2walls.Input.txt" in same folder as "cad2walls.jar"

Run "cad2walls.jar" >
Will generate "cad2walls.Output.sh3d"

It's the best I could do :-)
Cheers

4 Attachments

Discussion

  • xlance

    xlance - 2025-04-04

    UI

     

    Last edit: xlance 2025-04-04
  • xlance

    xlance - 2025-04-06

    cad2walls.lsp

    • Curves are supported ( Arcs, Circles, Ellipses, and Splines )
    • Simplified the process of Exporting points.
    • All lines are now saved as not joined and will be recognized as such in SH3D. This will prevent the effect of cross-linking.

    cad2walls.jar

    • Added a function to modify Scale before import into SH3D.
    • Added multi level error handling.

    Note:
    Added an Experimental option in cad2walls.lsp to mark lines which should be recognized as joined in SH3D.
    Lines are marked with a letter "j" at the beginning of each line.
    Then cad2walls.jar identifies the 'j' tag and add additional code to join them.

    However because the Autolisp script and SH3D read points in a different order, joined lines in output, sometimes do not match with marked lines by the script !

    For best results join Outer border lines only :-)

     

    Last edit: xlance 2025-04-07
  • xlance

    xlance - 2025-04-10

    cad2walls.lsp

    • Added a a new function to create a Layer tag at the end of each line

    cad2walls.jar

    • Added a new function to import coordinates as POLYLINES
    • Added a new function to import BOTH, Polylines and Walls based on Layer tags

    Note:

    • Supported Layer tags are "Walls" and "Poly" only
    • Removing a Layer tag completely, skips reading of item either a wall or a polyline !
     

    Last edit: xlance 2025-04-12
  • Seppo Taalasmaa

    Seppo Taalasmaa - 2025-09-09

    I can't get the conversion from cad2walls.Input.txt to SH3D to work. I've tried both my own CAD files and ones downloaded from this site. I also tried the 32-bit and 64-bit versions of Sweet Home 3D, but that didn't help.
    I tried these:
    "C:\Program Files (x86)\Java\latest\jre-1.8\bin\java.exe" -jar cad2walls.jar
    "C:\Program Files (x86)\Java\jre1.8.0_461\bin\java.exe" -jar cad2walls.jar

    And these:
    C:\cad2walls>java.exe -jar C:\cad2walls\cad2walls.jar
    Min X: 1000.0, Max Y: 9687.0
    Translate X: -1000.0, Translate Y: -9635.0
    Deleted temporary XML file: Home.xml
    Generated: cad2walls.Output.sh3d

    C:\cad2walls>java.exe -jar C:\cad2walls\cad2wallsolder.jar
    Min X: 1000.0, Max Y: 9687.0
    Translate X: -1000.0, Translate Y: -9635.0
    Deleted temporary XML file: Home.xml
    Generated: cad2walls.Output.sh3d

    C:\cad2walls>java.exe -jar C:\cad2walls\cad2wallsoldest.jar
    Deleted temporary XML file: Home.xml
    Generated: cad2walls.Output.sh3d

    It just say Error: Can't open home "C:\cad2walls\cad2walls.Output.sh3d"

     

    Last edit: Seppo Taalasmaa 2025-09-09
  • Seppo Taalasmaa

    Seppo Taalasmaa - 2025-09-09

    Here is one example of broken output.

     
    • Seppo Taalasmaa

      Seppo Taalasmaa - 2025-09-09

      I used this input file.

       
    • Dorin Vatavu

      Dorin Vatavu - 2025-09-10

      The problem is with decimal separator in Home.xml file inside of .sh3d file. Is "," in place of "."
      xStart='0,0000' yStart='-5200,0000' xEnd='1424100,0000' yEnd='-5200,0000'
      have to be
      xStart='0.0000' yStart='-5200.0000' xEnd='1424100.0000' yEnd='-5200.0000'
      You have to replace 'comma' with 'period' for all your walls.
      Probably you have set this locale somewhere in your system or for some applications.

       
  • xlance

    xlance - 2025-09-10

    Hello
    Thank You Dorin Vatavu :-)

    • Put both ( cad2walls.jar) and (cad2walls.Input.txt ) in the same folder
    • Click (cad2walls.jar) do not > java.exe" -jar cad2walls.jar
    • Choose an option
    • (cad2walls.Output.sh3d) wil be Auto generated

    Values in your cad2walls.Input.txt are too large so I used 1% scale, and sh3d was opened correctly on my pc :-)

    Attached is an Update of 'cad2walls.jar' which accepts either ' . ' or ' , '

    Cheers

     

    Last edit: xlance 2025-09-10
    • Seppo Taalasmaa

      Seppo Taalasmaa - 2025-09-15

      Thank you, but that did not resolve the issue. Apparently, Java takes the decimal separator from Windows, as I was able to get it to work by forcing Windows to pretend that I am in the US. Attached are the Windows locale settings that work.

       
      • Seppo Taalasmaa

        Seppo Taalasmaa - 2025-09-15

        Here are the correct locale settings for me, where the comma is used as a separator, but then generated cad2walls.Output.sh3d no longer opens.

         
  • xlance

    xlance - 2025-09-15

    I guess the issuse is not with ' , ' instead of ' . ' but of thousands sperator ' ' instead ' , '
    Try this adjusted version on finnish local settings !

     

Log in to post a comment.

MongoDB Logo MongoDB