CogoPoints2Structures_vs.00

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), so it avoids Civil 3D COM version issues.
icon cogopoints2structures

Command:

Main Command:CogoPoints2Structures   → Prompts for a template structure and a set of COGO points, then creates one new structure per COGO point.

Description:

What the routine does: 1. Asks the user to pick a template structure (AeccDbStructure) in the drawing. 2. Lets the user select a set of COGO points (AECC_COGO_POINT). 3. For each selected COGO point it:   • Copies the template structure (vla-Copy).   • Moves the copy to the point’s Location via SetLocation (3D point).   • Sets RimElevation equal to the COGO point’s Elevation. 4. Prints how many structures were created.
Basic flow & safety: • If the picked entity is not an AeccDbStructure, it warns and lets you try again. • If no valid template is selected → exits with a message. • If no COGO points are selected → exits with “No COGO points selected.” • CMDECHO is turned off during processing and restored at the end (even on error).

Helper function: (if any)​

Helper / internal logic: Error handling • Local *error* definition inside the command:   – Restores CMDECHO back to its original value.   – Suppresses standard “Function cancelled” style messages.   – Prints a generic "Error: <msg>" if the error is not user cancel/break/quit. Key COM calls • Template structure pick:   – (entsel)vlax-ename->vla-object → checks ObjectName = "AeccDbStructure". • COGO point data:   – Location property → 3D point where the structure will be placed.   – Elevation property → rim Z for the new structure. • Structure copy & placement:   – (vla-Copy tmplStruct) → new structure object.   – (vlax-invoke newStruct 'SetLocation loc) → move to point.   – (vlax-put newStruct 'RimElevation ptElev) → set rim elevation.

Functionalities:

Main functionalities: 1. Turn COGO points into fully-fledged structures • Quickly convert survey / design COGO points into structures (manholes, inlets, etc.) that share all properties of a chosen template. • Geometry and style come from the template; position and elevation come from each COGO point. 2. Template-driven consistency • You control layer, style, parts list, and other structure properties via the template structure you select at the beginning. • All created structures are identical clones of that template, only moved and updated for rim elevation. 3. Simple selection model • Template: one picked object, must be AeccDbStructure. • COGO points: ssget with filter ((0 . "AECC_COGO_POINT")) – window, crossing, filter, etc., all allowed. 4. Safe and version-agnostic • No use of AeccXUiPipe or AeccPipeApplication means fewer issues across different Civil 3D versions. • Clean local error handler makes it safe to cancel midway without leaving CMDECHO changed.

Result:

Result / Usage (02): 1. Type CogoPoints2Structures in the command line. 2. When prompted, click on an existing template manhole/structure (must be AeccDbStructure). 3. Then select one or more COGO points (e.g. by window, filter, or manual picks). 4. The routine will:   – Create a copy of the template for each selected COGO point.   – Move each copy to the COGO point’s Location.   – Set each structure’s RimElevation to the point’s Elevation. 5. At the end it reports how many structures were created from the template.
Final outcome: you instantly populate your Civil 3D model with correctly positioned and elevated structures, one per COGO point, all styled and configured identically to the chosen template.

Images, animations etc.

icon cogopoints2structures
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="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>



Additional info:

Share this page:

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Tags: 🏷️ C3D_Pipe_Network_menu, 🏷️ C3D_tools
0
Would love your thoughts, please comment.x
()
x