Code Monkey home page Code Monkey logo

acadsvgstudio's Introduction

ACad SVG Studio

A simple application to load and convert AutoCAD documents (DWG or DXF) to SVG using ACadSVG and ACadSharp. SVG code can be viewed and edited in a Scintilla text editor. The resulting drawing is displayed in an integrated browser control.

ACad SVG Studio was designed to support projects with a produktLogika product configurator that combines parts of 2D drawings created in AutoCAD. produktLogika® is nanoLogika's catalog-based product configuration system.

Thus the converter focuses on converting the block structure, especially dynamic blocks, rather than just converting a drawing.

Download Demo.

Short Description

  • DWG, DXF, or SVG documents can be loaded using the File menu or by drag-and-drop.
  • The SVG text shows up in the editor on tab Main Group, and the drawing is displayed in the integrated browser control.
  • The displayed drawing can be scaled with the mouse wheel and moved with the mouse.
  • The SVG text can be modified in the Main Group editor. Additional SVG text and style definitions can be edited in the Scales editor and the CSS-for-Preview editor. The effect of the modifications appears immediately in the integrated browser control.
  • Converted and modified SVG text can be saved.

Editors

Main Group

Contains the SVG text as converted from the DWG document. It can be edited manually.

Scales

In this editor additional SVG elements such as scales or frames can be edited. If the View option Scales Enabled is set, these elements are included in the displayed SVG drawing. The text of the Scales editor is saved with the application settings.

CSS for Preview

In this tab a CSS can be edited that is used for the display of the SVG drawing in the integrated browser. The text of the CSS-for-Preview editor is saved with the application settings.

Conversion

  • All BlockRecord elements found in the DWG document are converted to SVG groups and included in an SVG defs element.
  • Other elements are included in the main group. When SVG text is converted from an AutoCAD DWG document the y-direction has to be reversed (see below). To enable that coordinates are used as they are delivered from AutoCAD, the main group must have a transform attribute containing the value scale(1, -1).
  • See https://github.com/nanoLogika/ACadSvg.

Property Grid

Conversion Options

Conversion options can be specified in the property grid visible in the application window to be applied in the conversion process. If conversion options are changed the DWG document has to be loaded again to repeat the conversion using the new options.

  • Create class Attribute from Layer Name
  • Create class Attribute from Object Type
    A class attribute is created for each converted AutoCAD element with the layer name and/or the object type. The assigned classes can be adressed in the CSS-for-Preview tab.
  • Create id Attribute from Handle
    An id attribute is created for each converted element. The element's handle provided by AutoCAD is used as the id value.
  • Reverse Y-Direction
    This flag indicates that the positive y-direction is up instead of down. In SVG the y-coordinates grow from top to bottom. In AutoCAD the positive y-direction is up. If this flag is set, a transform attribute is assigned to the main group, so that y-coordinates from AutoCAD can be used as they are.
  • Create Scale-Box from Model-Space Extent
    A rectangle with the coordinates of the model-space extent is created as SVG and stored in the scales editor.
  • Create Viewbox Rectangle from Model-Space Extent
    The coordinates of the model-space extent are entered into the viewbox settings.
  • Lineweight Scale Factor
    This scale factor is used to scale lineweights. Specify 0 to use lineweights as they are.

Viewbox

With these settings a viewbox attribute can be defined for the display in the integrated browser control. If the viewbox attribute is enabled, only the portion of the drawing that is inside the viewbox is visbible. The Center-to-Fit option considers only this portion of the drawing.

Viewbox bounds have to be specified in the coordinate system of the drawing. If the Reverse Y-Direction option is set, the actual viewbox attribute is adjusted accordingly.

When an SVG document is saved, no viewbox attribute is assigned to the SVG element. But the viewbox width and height are used for the width and height attribute of the SVG element.

View

  • Background Color
    Sets the background color for the display of the SVG-drawing in the integrated browser control.
  • Apply "CSS-for-Preview"
    Styles defined in the CSS-for-Preview editor are included in the HTML-code used for the display in the integrated browser control.
  • Scales Enabled
    Additional SVG elements edited in the Scales editor are included in the SVG-drawing displayed in the integrated browser control.

Menu Reference

File Menu

  • Open
    Loads and converts DWG files. Loads SVG files or SVG groups.
  • Save
    Saves the current SVG document with the filename as read or defaults to Save as ....
  • Save as ...
    Saves the current SVG text visible in the editor as is or as a complete SVG document, i.e. enclosed in an SVG element.

Edit Menu

  • Undo, Redo, Cut, Copy, Paste, Delete, Select All.

Search Menu

  • Quick Find
    Activates a seach field for the Main Group editor.

  • Find and Replace
    Opens a find-and-replace dialog for the Main Group editor.

View Menu

  • Center To Fit
    Centers the SVG drawing and scales it so that it fits into the browser control.

  • (Show/Hide) Property Grid

  • Collapse All
    Collapses all nodes of the SVG text.

  • Expand All
    Expands all nodes of the SVG text.

Content Menu

  • Restore Previous
    After loading a new DWG or SVG document restores the previous SVG document.

Extras Menu

  • Editor Font
    Displays the font-selector dialog to select the editor font.

  • Remove Styles
    Removes style attributes from all elements.

  • Show Developer Tools
    Opens the developer-tools window of the integrated browser control.

Conversion Info

  • Show Conversion Log
    Opens a window displaying the log of the last DWG/SVG conversion and a summary of the AutoCAD entities found.

Dependencies

NOTE: Currently not all ACadSharp features required by ACadSvg are pushed to ACadSharp. If you clone this repository you will get the ACadSharp.dll built from https://github.com/mme1950/ACadSharp.

acadsvgstudio's People

Contributors

mme1950 avatar nka1994 avatar

Stargazers

 avatar Manfredi avatar

Forkers

timmwille

acadsvgstudio's Issues

Test findings

  • New conversion option ExportObjectTypeAsClass
  • xmlns issue fixed, remove work-around.
  • GetSVG: Back to string builder!
  • #2
  • #3
  • All changes in property grid except conversion options must trigger browser-display update.
  • #4
  • #5
  • Ensure form is on-screen
  • Font Dialog for Editor
  • Svg Keywords

New conversion options

  • New conversion Options

    • LineweightScaleFactor
    • CreateScaleFromModelSpaceExtent
    • CreateViewboxFromModelSpaceExtent
  • Implement CreateScaleFromModelSpaceExtent

Search-Dialog

  • Text selected in the editor should be copied as search text.
  • Scroll found text into view!
  • Recent searches in dropdown box

Collapse

  • Collapse all/Expand all must fold recursively

Settings Rework

  • New conversion option DefaultLineweight
  • Remove setting EnableComments
  • New setting: EnableStrokeWidth
  • Rename settings and unify display names

Application enhancements and

  • Display of SVG in Browser Control freezes, zooming and moving blocked.
  • RecentlyOpenedFiles in File menu.
  • New conversion option in Property Grid: Filter Block by name.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.