CogoPoints2Structures_vs.01

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 TEMPLATE structure (must be AeccDbStructure).
  • Select multiple COGO points (filter: AECC_COGO_POINT).
  • 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.

Pixel

Additional info:

Share this page:

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x