Skip to content

Application to manage SVG documents, that were converted from AutoCAD documents using the ACadSvg library.

License

Notifications You must be signed in to change notification settings

nanoLogika/ACadSvgStudio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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. Please use the "merged" branch from this repository.

About

Application to manage SVG documents, that were converted from AutoCAD documents using the ACadSvg library.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages