Purpose
Create a copied Civil 3D structure at each selected COGO point, positioned and elevated from the point data.
Scope
Works directly with AeccDbStructure and AeccDbCogoPoint objects using COM, without AeccXUiPipe or AeccPipeApplication dependencies.
Command:
Command name
CogoPoints2Structures
How to run
Load the LISP, then run: CogoPoints2Structures
Description:
What it does
Select one TEMPLATE structure (must be AeccDbStructure).
For each selected COGO point, copy the template structure, move it to the point location, and set the new structure rim elevation to the point elevation.
Key behavior
If the picked template is not an AeccDbStructure, it prompts again until a valid structure is selected or the selection is canceled.
Helper function: (if any)β
Local error handler
*error* restores CMDECHO to its prior value (prevents command echo from staying disabled).
Suppresses printing for normal cancel and quit messages; prints other errors as Error: ….
Used both on failure paths and for clean exit to ensure environment cleanup.
Functionalities:
Main steps
Loads COM support via vl-load-com.
Saves current CMDECHO and sets it to 0 for quiet execution, then restores it on exit.
Validates the selected template by checking (vla-get-ObjectName obj) equals AeccDbStructure.
Collects COGO points using a selection set filter: ((0 . “AECC_COGO_POINT”)).
For each point: reads Location (3D point) and Elevation.
Copies the template structure with (vla-Copy tmplStruct).
Moves the new structure to the point using (SetLocation loc).
Sets RimElevation to the point elevation using (vlax-put newStruct ‘RimElevation ptElev).
Result:
User-visible outcomes
If no valid template structure is selected: prints “No valid template structure selected.” and exits cleanly.
If no COGO points are selected: prints “No COGO points selected.” and performs no changes.
On success: prints a completion message like “Created N structures from template.” where N equals the number of selected points.
All runs restore CMDECHO; unexpected failures print Error: ….
Images, animations etc.
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="CogoPoints2Structures">
<src:RibbonToolTip.ExpandedContent>
<StackPanel>
<TextBlock Background="AntiqueWhite" TextAlignment="Left">
<Bold>Function Syntax: CogoPoints2Structures</Bold>
<LineBreak/>
<Bold>Version: 1 Date: 04.12.2025</Bold>
<LineBreak/>
<LineBreak/>
<Hyperlink>AI</Hyperlink>
<LineBreak/>
<Bold>Description</Bold><LineBreak/>
This program allows the user to automatically create copies of a template Civil 3D Structure and place them at the locations of selected COGO Points, matching each structureβs Rim Elevation to the pointβs Elevation.<LineBreak/><LineBreak/>
<Bold>Main Functionalities</Bold><LineBreak/>
β’ The user is prompted to select a template structure (<Bold><Run Foreground="DarkRed">AeccDbStructure</Run></Bold>).<LineBreak/>
β’ The routine validates that the selected object truly is an <Bold><Run Foreground="DarkRed">AeccDbStructure</Run></Bold>.<LineBreak/>
β’ The user then selects multiple COGO Points (<Bold><Run Foreground="DarkRed">AeccDbCogoPoint</Run></Bold>) to define where new structures will be placed.<LineBreak/>
β’ For each COGO Point, the routine performs the following actions:<LineBreak/>
β’ Creates a copy of the template structure using <Bold><Run Foreground="Red">vla-Copy</Run></Bold>.<LineBreak/>
β’ Retrieves the point's Location and Elevation using <Bold><Run Foreground="Red">vlax-get</Run></Bold>.<LineBreak/>
β’ Moves the copied structure to the COGO Point using <Bold><Run Foreground="Red">SetLocation</Run></Bold>.<LineBreak/>
β’ Sets the structure's RimElevation equal to the COGO Point's Elevation with <Bold><Run Foreground="Red">vlax-put</Run></Bold>.<LineBreak/>
β’ When complete, the routine reports the number of structures created.<LineBreak/><LineBreak/>
<Bold>Important Implementation Details</Bold><LineBreak/>
β’ COM is loaded using <Bold><Run Foreground="Red">vl-load-com</Run></Bold>.<LineBreak/>
β’ <Bold><Run Foreground="DarkRed">CMDECHO</Run></Bold> is temporarily disabled to keep the command line clean.<LineBreak/>
β’ A custom error handler restores settings and avoids abnormal termination.<LineBreak/>
β’ Only AeccDbStructure objects are accepted as templates.<LineBreak/>
β’ Only AECC_COGO_POINT objects are accepted for placement locations.<LineBreak/><LineBreak/>
<Bold>Workflow Summary</Bold><LineBreak/>
β’ User selects a template structure.<LineBreak/>
β’ User selects a set of COGO Points.<LineBreak/>
β’ The routine loops through all selected points.<LineBreak/>
β’ For each point:<LineBreak/>
β’ Template is copied.<LineBreak/>
β’ Copy is moved to point location.<LineBreak/>
β’ Rim elevation is synchronized with COGO Point elevation.<LineBreak/>
β’ Confirmation message displays how many structures were created.<LineBreak/>
</TextBlock>
<Grid>
<Image Source="PNG" Stretch="Uniform"/>
</Grid>
<Grid>
<MediaElement
Source="GIF"
Stretch="Uniform"
Visibility="Visible"/>
</Grid>
</StackPanel>
</src:RibbonToolTip.ExpandedContent>
</src:RibbonToolTip>
</ResourceDictionary>
Short description Purpose Create a copied Civil 3D structure at each selected COGO point, positioned and elevated from the point data. Scope Works directly with AeccDbStructure and AeccDbCogoPoint objects using COM, without AeccXUiPipe or AeccPipeApplication dependencies. Command: Command name CogoPoints2Structures How to run Load the LISP, then run: CogoPoints2Structures Description: What it does Select one…
Short description Sort / Purpose: Create a Civil 3D Structure (AeccDbStructure) at every selected COGO point, by copying a user-chosen template structure and placing the copies at each pointβs location with rim set to point elevation. β’ Scope: Batch βstampβ manholes/inlets/etc. on COGO points. β’ Dependency: Uses only AeccDb COM objects (no AeccXUiPipe / AeccPipeApplication),…
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="CogoPoints2Structures"> <src:RibbonToolTip.ExpandedContent> <StackPanel> <TextBlock Background="AntiqueWhite" TextAlignment="Left"> <Bold>Function Syntax: CogoPoints2Structures</Bold> <LineBreak/> <Bold>Version: 1 Date: 04.12.2025</Bold> <LineBreak/> <LineBreak/> <Hyperlink>AI</Hyperlink> <LineBreak/> <Bold>Description</Bold><LineBreak/> This program allows the user to automatically create copies of a template Civil 3D Structure and place them at the locations of…
Short description Sort / Purpose: Civil 3D utility to set pipe invert elevations from selected TIN Surfaces and/or Profiles, using separate elevation offsets for each source and a scrollable, filterable UI for many pipes. β’ Scope: Works with AeccDbPipe (model), pipe profile-views, TIN Surfaces and Profiles, using wildcard filters and βApplyβ inside the dialog so…
Short description Sort / Purpose: Civil 3D utility to set structure (manhole) elevations based on TIN Surfaces and/or Profiles, using a scrollable dialog with filters. β’ Scope: Works with AeccDbStructure and profile-view network parts, using profiles or surfaces as elevation sources, with separate offsets. β’ Priority: For each manhole, it tries Profiles first; if no…
Short description Sort / Purpose: A pipe-only shortcut command that still launches the same full UI. User may ignore manhole lists if not needed. Type: Shortcut alias to the master interface Scope: Provides access to all pipe-related elevations Goal: Simpler entry for users working only with pipes Sort / Purpose: A pipe-only shortcut command that…
Leave a Reply
You must be logged in to post a comment.