3DF_to_3DPoly

Short description

🚀 3DF_to_3DPoly is an AutoCAD and Civil 3D AutoLISP utility that converts selected 3DFACE entities into closed 3D polylines while preserving the original vertex elevations. It helps CAD and Civil 3D users transform face-based geometry into editable 3D polyline boundaries for cleanup, drafting, terrain preparation, and production drawing workflows.

Command:

🧰 Load the LISP file with APPLOAD or (load "3DF_to_3DPoly.lsp").
🚀 Run the command 3df2pl in AutoCAD or Civil 3D.
📌 Select one or more 3DFACE entities when prompted.
🧩 The routine creates a closed 3DPOLY for each selected face using the 3DFACE vertex DXF points 10, 11, 12, and 13.
📘 Target platform: AutoCAD and Civil 3D with Visual LISP and standard AutoLISP command support.

Description:

📘 3DF_to_3DPoly is a focused AutoLISP conversion tool for AutoCAD and Civil 3D users who need to convert 3DFACE geometry into normal closed 3D Polyline objects.

🔍 The user runs 3df2pl, selects the required 3DFACE entities in the drawing, and the program reads the four vertex coordinates stored in the entity definition. Each face is then recreated as a closed 3D polyline using the AutoCAD ._3dpoly command.

📐 Because the routine uses the original 3D face vertex points, the resulting 3D polylines keep the Z elevations from the source faces. This is useful for Civil 3D cleanup, survey geometry processing, 3D drafting, terrain boundary preparation, legacy DWG conversion, and CAD quality-control workflows.

🧠 The LISP includes a Civil 3D compatibility header, a guarded vl-load-com pattern, local error handling, and system variable restoration for CMDECHO and OSMODE. The workflow is intentionally simple: select faces, convert them, and continue working with editable 3D polyline geometry.

Helper function: (if any)​

  • 🚀 Command entry pointc:3df2pl defines the user command that starts the 3DFACE to 3D polyline conversion workflow.
  • 🔍 3DFACE selection filterssget uses the filter ((0 . "3DFACE")) so only valid 3DFACE objects are selected for conversion.
  • 📐 DXF vertex extractionentget reads the selected entity data, and LI_item retrieves vertex codes 10, 11, 12, and 13.
  • 🧩 3D polyline creation – the AutoCAD ._3dpoly command is called with all four source face vertices and then closed with _Close.
  • 🧠 Elevation preservation – the routine passes full 3D point lists to 3DPOLY, so the converted geometry keeps the original X, Y, and Z coordinates.
  • 🔒 System variable protectionCMDECHO and OSMODE are saved before processing and restored through the local *error* handler.
  • 🧹 Civil 3D compatibility guard – the header avoids unsafe top-level COM behavior and uses a guarded Visual LISP COM-loading pattern.
  • 📌 Small helper functionLI_item returns the value of a requested DXF dotted pair from an association list, keeping the conversion logic concise and readable.

Functionalities:

  • 🚀 Convert 3DFACE to 3D Polyline – quickly transforms face geometry into editable closed 3D polyline objects.
  • 📐 Preserve vertex elevations – keeps the original Z values from the selected 3DFACE vertices.
  • 🔍 Select multiple faces – processes an AutoCAD selection set so several 3DFACE entities can be converted in one command run.
  • 🧩 Create closed boundaries – uses the four face vertices and closes the generated 3D polyline automatically.
  • 🧠 Use direct DXF data – reads entity vertex data from entget instead of relying on manual point picking.
  • 🔒 Restore drafting settings – returns CMDECHO and OSMODE after processing or after an error.
  • 🧹 Improve drawing cleanup – helps replace legacy 3DFACE objects with more practical 3D polyline geometry for CAD editing.
  • 📘 Support Civil 3D production workflows – useful before terrain cleanup, feature interpretation, surface boundary preparation, 3D drafting, and DWG conversion tasks.

Result:

✅ The final result is a practical AutoCAD and Civil 3D AutoLISP utility that converts selected 3DFACE objects into closed 3D polylines with elevation-aware vertices. It improves drawing cleanup, makes legacy 3D face geometry easier to edit, reduces manual tracing, and supports faster 3D CAD and Civil 3D production workflows.

Images, animations etc.

Pixel

XAML code:

<ResourceDictionary
 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 xmlns:src="clr-namespace:Autodesk.Windows;assembly=AdWindows">
 
 <src:RibbonToolTip x:Key="3DF_to_3DPoly">
 <src:RibbonToolTip.ExpandedContent>
 <StackPanel>
 <TextBlock Background="AntiqueWhite" TextAlignment="Left">
<Bold>Function Syntax: 3DF2PL</Bold>
<LineBreak/>
<Bold>Version: 1.0 Date: 20.06.2026 2:44:37PM</Bold>
<LineBreak/>
<Hyperlink>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/3d-face-to-polylines-macro/td-p/7585662</Hyperlink>
<LineBreak/>		
<Bold><Run Foreground="DodgerBlue">short_description:</Run></Bold><LineBreak/>
<Run Foreground="White">🚀 3DF_to_3DPoly is an AutoCAD and Civil 3D AutoLISP utility that converts selected </Run><Bold><Run Foreground="DarkRed">3DFACE</Run></Bold><Run Foreground="White"> entities into closed </Run><Bold><Run Foreground="DarkRed">3D polylines</Run></Bold><Run Foreground="White"> while preserving vertex elevations.</Run><LineBreak/>
<Run Foreground="LimeGreen">The main benefit is faster CAD cleanup, easier 3D geometry editing, and better Civil 3D production preparation.</Run><LineBreak/>
<Bold><Run Foreground="DodgerBlue">command:</Run></Bold><LineBreak/>
<Run Foreground="White">🧰 Load the LISP with </Run><Bold><Run Foreground="Orange">APPLOAD</Run></Bold><Run Foreground="White"> or </Run><Bold><Run Foreground="Orange">(load "3DF_to_3DPoly.lsp")</Run></Bold><Run Foreground="White">.</Run><LineBreak/>
<Run Foreground="White">🚀 Run </Run><Bold><Run Foreground="Orange">3df2pl</Run></Bold><Run Foreground="White"> to start the conversion command.</Run><LineBreak/>
<Run Foreground="White">📌 Select one or more </Run><Bold><Run Foreground="Orange">3DFACE</Run></Bold><Run Foreground="White"> objects from the active drawing.</Run><LineBreak/>
<Run Foreground="White">🧩 The routine creates a closed </Run><Bold><Run Foreground="Orange">3DPOLY</Run></Bold><Run Foreground="White"> using DXF vertex codes </Run><Bold><Run Foreground="Orange">10</Run></Bold><Run Foreground="White">, </Run><Bold><Run Foreground="Orange">11</Run></Bold><Run Foreground="White">, </Run><Bold><Run Foreground="Orange">12</Run></Bold><Run Foreground="White">, and </Run><Bold><Run Foreground="Orange">13</Run></Bold><Run Foreground="White">.</Run><LineBreak/>
<Bold><Run Foreground="DodgerBlue">description:</Run></Bold><LineBreak/>
<Run Foreground="White">📘 This AutoLISP program converts AutoCAD </Run><Bold><Run Foreground="DarkRed">3DFACE</Run></Bold><Run Foreground="White"> geometry into normal closed </Run><Bold><Run Foreground="DarkRed">3D Polyline</Run></Bold><Run Foreground="White"> objects.</Run><LineBreak/>
<Run Foreground="White">🔍 The user runs the command, selects the faces, and the tool reads the original vertex coordinates directly from the entity data.</Run><LineBreak/>
<Run Foreground="White">📐 Each source face is recreated as a closed 3D polyline, making the geometry easier to edit, inspect, export, or reuse in Civil 3D workflows.</Run><LineBreak/>
<Run Foreground="LimeGreen">Because the source X, Y, and Z points are reused, the generated 3D polylines retain the elevation information from the original faces.</Run><LineBreak/>
<Bold><Run Foreground="LimeGreen">helper_function:</Run></Bold><LineBreak/>
<Run Foreground="White">🚀 </Run><Bold><Run Foreground="LimeGreen">Command entry point</Run></Bold><Run Foreground="White"> - c:3df2pl defines the main AutoCAD command.</Run><LineBreak/>
<Run Foreground="White">🔍 </Run><Bold><Run Foreground="LimeGreen">Selection filter</Run></Bold><Run Foreground="White"> - ssget limits selection to 3DFACE objects.</Run><LineBreak/>
<Run Foreground="White">📐 </Run><Bold><Run Foreground="LimeGreen">DXF vertex extraction</Run></Bold><Run Foreground="White"> - entget reads entity data and LI_item extracts vertex codes 10, 11, 12, and 13.</Run><LineBreak/>
<Run Foreground="White">🧩 </Run><Bold><Run Foreground="LimeGreen">3D polyline creation</Run></Bold><Run Foreground="White"> - the command ._3dpoly creates the converted geometry and _Close closes the boundary.</Run><LineBreak/>
<Run Foreground="White">🔒 </Run><Bold><Run Foreground="LimeGreen">System variable restoration</Run></Bold><Run Foreground="White"> - CMDECHO and OSMODE are restored through the local error handler.</Run><LineBreak/>
<Run Foreground="White">🧹 </Run><Bold><Run Foreground="LimeGreen">Civil 3D-safe header</Run></Bold><Run Foreground="White"> - the LISP includes guarded Visual LISP COM loading and safer command behavior notes.</Run><LineBreak/>
<Bold><Run Foreground="LimeGreen">functionalities:</Run></Bold><LineBreak/>
<Run Foreground="White">🚀 </Run><Bold><Run Foreground="LimeGreen">Convert 3DFACE to 3D Polyline</Run></Bold><Run Foreground="White"> - turns selected face entities into editable closed 3D polylines.</Run><LineBreak/>
<Run Foreground="White">📐 </Run><Bold><Run Foreground="LimeGreen">Preserve elevations</Run></Bold><Run Foreground="White"> - keeps the original Z values from the source vertices.</Run><LineBreak/>
<Run Foreground="White">🔍 </Run><Bold><Run Foreground="LimeGreen">Batch selection</Run></Bold><Run Foreground="White"> - converts multiple 3DFACE objects in one command run.</Run><LineBreak/>
<Run Foreground="White">🧩 </Run><Bold><Run Foreground="LimeGreen">Closed geometry output</Run></Bold><Run Foreground="White"> - automatically closes each generated 3D polyline.</Run><LineBreak/>
<Run Foreground="White">🧠 </Run><Bold><Run Foreground="LimeGreen">Direct entity data workflow</Run></Bold><Run Foreground="White"> - uses DXF data instead of manual point picking.</Run><LineBreak/>
<Run Foreground="White">📘 </Run><Bold><Run Foreground="LimeGreen">Civil 3D cleanup support</Run></Bold><Run Foreground="White"> - helps prepare legacy DWG geometry for production drafting and terrain-related workflows.</Run><LineBreak/>
<Bold><Run Foreground="DodgerBlue">result:</Run></Bold><LineBreak/>
<Run Foreground="White">✅ The final result is a lightweight AutoCAD and Civil 3D conversion tool that produces closed 3D polylines from selected 3DFACE entities.</Run><LineBreak/>
<Run Foreground="LimeGreen">It reduces manual tracing, improves 3D drawing cleanup, and makes legacy face-based geometry easier to manage in CAD production.</Run><LineBreak/>
<Bold><Run Foreground="DarkOrange">additional_info:</Run></Bold><LineBreak/>
<Run Foreground="White">📌 The routine converts only </Run><Bold><Run Foreground="Orange">3DFACE</Run></Bold><Run Foreground="White"> entities and does not create Civil 3D surfaces, feature lines, alignments, corridors, or section views.</Run><LineBreak/>
<Run Foreground="White">🔴 Triangular faces with repeated vertices may create a closed 3D polyline with overlapping points.</Run><LineBreak/>
<Run Foreground="White">🔐 The command saves and restores </Run><Bold><Run Foreground="Orange">CMDECHO</Run></Bold><Run Foreground="White"> and </Run><Bold><Run Foreground="Orange">OSMODE</Run></Bold><Run Foreground="White"> for safer drafting behavior.</Run><LineBreak/>

</TextBlock>
 
 <!-- Use MediaElement for GIF (static first frame) and Image as fallback -->

 
 
 </StackPanel>
 </src:RibbonToolTip.ExpandedContent>
 </src:RibbonToolTip>
</ResourceDictionary>

Share this page:

Page Tag: 🏷️ Autocad Lisps

  • 3DF_to_3DPoly

    Short description Command: Description: Helper function: (if any)​ Functionalities: Result: Images, animations etc. XAML code: Expand Code ↓ Select Code Copy Code <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:src="clr-namespace:Autodesk.Windows;assembly=AdWindows"> <src:RibbonToolTip x:Key="3DF_to_3DPoly"> <src:RibbonToolTip.ExpandedContent> <StackPanel> <TextBlock Background="AntiqueWhite" TextAlignment="Left"> <Bold>Function Syntax: 3DF2PL</Bold> <LineBreak/> <Bold>Version: 1.0 Date: 20.06.2026 2:44:37PM</Bold> <LineBreak/> <Hyperlink>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/3d-face-to-polylines-macro/td-p/7585662</Hyperlink> <LineBreak/> <Bold><Run Foreground="DodgerBlue">short_description:</Run></Bold><LineBreak/> <Run Foreground="White">🚀 3DF_to_3DPoly is an AutoCAD and Civil…

  • BookmarkEntities

    Short description Command: Description: Helper function: (if any)​ Functionalities: Result: Images, animations etc. XAML code: Expand Code ↓ Select Code Copy Code <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:src="clr-namespace:Autodesk.Windows;assembly=AdWindows"> <src:RibbonToolTip x:Key="BookmarkEntities"> <src:RibbonToolTip.ExpandedContent> <StackPanel> <TextBlock Background="AntiqueWhite" TextAlignment="Left"> <Bold>Function Syntax: BookmarkEntities</Bold> <LineBreak/> <Bold>Version: 1 Date: 30.11.2025</Bold> <LineBreak/> <LineBreak/> <Hyperlink>N/A</Hyperlink> <LineBreak/> <Bold>Description</Bold><LineBreak/> This AutoLISP program defines the command <Run Foreground="Red">BMEntityPos</Run>, which…

  • XrNet

    Short description Command: Description: Helper function: (if any)​ Functionalities: Result: Images, animations etc. XAML code: Expand Code ↓ Select Code Copy Code <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:src="clr-namespace:Autodesk.Windows;assembly=AdWindows"> <src:RibbonToolTip x:Key="UnReloadDetachSelectedXrefs"> <src:RibbonToolTip.ExpandedContent> <StackPanel> <TextBlock Background="AntiqueWhite" TextAlignment="Left"> <Bold>Function Syntax: XRNET / XRSPLIT / XRPREDEFINEDFOLDERS / XRSAVELOG</Bold> <LineBreak/> <Bold>Version: 0 Date: 18.09.2025</Bold> <Bold>Version: 1 Date: 14.01.2026</Bold> <LineBreak/> <Bold>Version: 2 Date:…

  • BoQExtra

    Short description Short description Command: Description: Helper function: (if any)​ Functionalities: Result: Images, animations etc. XAML code: Expand Code ↓ Select Code Copy Code <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:src="clr-namespace:Autodesk.Windows;assembly=AdWindows"> <src:RibbonToolTip x:Key="3DF_to_3DPoint"> <src:RibbonToolTip.ExpandedContent> <StackPanel> <TextBlock Background="AntiqueWhite" TextAlignment="Left"> <Bold>Function Syntax: 3DF_to_3DPoint</Bold> <LineBreak/> <Hyperlink>https://www.cadforum.cz/en/download.asp?fileID=967</Hyperlink> <LineBreak/> <Bold>Description</Bold><LineBreak/> This AutoLISP command converts each selected 3DFACE into four AutoCAD POINT entities placed…

  • UnReloadDetachSelectedXrefs_vs.02

    Short description 🚀 XRNET is an AutoCAD and Civil 3D .NET Framework plugin designed for fast DWG xref and raster image reference management. It helps CAD users inspect, reload, unload, detach, validate, preview, export, repair, and apply external references directly from the active drawing. The main benefit is faster drawing cleanup, better xref control, fewer…

  • RotateUcs_vs.01

    Short description 🧭 RotateUcsCs is an AutoCAD and Civil 3D C# .NET plugin that replaces a traditional RotateUCS AutoLISP DCL tool with a modeless WinForms UCS management palette. It helps users rotate UCS by typed angle, picked angle, or selected entity angle, save named UCS records, restore UCS definitions, export and import UCS data, copy…

  • CreateBlockSelect

    Short description 🚀 CreateBlockSelect.lsp is an AutoCAD and Civil 3D AutoLISP block creation utility that converts selected drawing entities into reusable named blocks with automatic numbering, insertion-point control, layer assignment, optional MText labels, optional TAG attributes, block renaming, and a dedicated undo action. It improves CAD productivity by reducing repetitive drafting steps and helping users…

  • MultiOffsetBothSidesWithLayerExtra

    Short description MultiOffsetBothSidesWithLayerExtra / MOBSWLE is an AutoCAD and Autodesk Civil 3D C# .NET plugin for creating multiple parallel offsets on both sides of selected line or polyline geometry. It is designed for utility, pipe, duct, Schutzrohr, KK, and DN layout workflows where users need fast, repeatable, layer-controlled offset generation with live WinForms preview, model-space…

  • UnReloadDetachSelectedXrefs_01

    Short description UnReloadDetachSelectedXrefs Xref management dialog for filtering, selecting, zooming, saving lists, loading lists, and batch operations on xrefs in the current drawing. Command: Command UnReloadDetachSelectedXrefs Description: Description This lisp scans the current drawing for xref definitions and displays them in a multi-column dialog (Name, Type, Units, Layer) with synchronized selection across columns. It allows…

  • UnReloadDetachSelectedXrefs

    XAML code: Expand Code ↓ Select Code Copy Code <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:src="clr-namespace:Autodesk.Windows;assembly=AdWindows"> <src:RibbonToolTip x:Key="UnReloadDetachSelectedXrefs"> <src:RibbonToolTip.ExpandedContent> <StackPanel> <TextBlock Background="AntiqueWhite" TextAlignment="Left"> <Bold>Function Syntax: XRNET / XRSPLIT / XRPREDEFINEDFOLDERS / XRSAVELOG</Bold> <LineBreak/> <Bold>Version: 0 Date: 18.09.2025</Bold> <Bold>Version: 1 Date: 14.01.2026</Bold> <LineBreak/> <Bold>Version: 2 Date: 08.04.2026</Bold> <LineBreak/> <Bold>Version: 3 Date: 07.07.2026 8:55:26AM</Bold> <LineBreak/> <Hyperlink>N/A</Hyperlink> <LineBreak/> <Bold><Run Foreground="DodgerBlue">SEO Description</Run></Bold><LineBreak/>…