Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

[V8i VBA] Attempting to automate placement of multiple points along element using VBA

$
0
0

Not sure if this is achievable or not so looking for some confirmation.

Scenario:

I have a DGN file which contains a long linestring and I need to place 109 points at unique distances (from a .XLS file) along the element starting from its left end.

What have I done so far?

  1. I have recorded a macro of myself placing a point along the element  using the 'Construct Active Point @ Dist Along Element'. (keyin: CONSTRUCT POINT DISTANCE)
  2. I copy out the relevant VBA code from the recorded macro and paste into an excel spreadsheet into column A. The copied VBA code is changed slightly by replacing the distance value typed into dialog box with a keyword string.
  3. Column B contains the distances of each desired point location (I per cell per row)
  4. Column C contains a formula to locate where in the coped VBA code that this keyword exists and returns a number.
  5. Column D uses the replace function to display the final output of replacing the keyword with the distance.
  6. I copy out the result of column D into notepad ++, remove additional quotation marks that get created when taking text out of excel and paste into the macro in MicroStation VBA editor.

What happens now?

I run the macro and I can see the dialog box rapidly change numbers however no points are created. The Message Center says no element found so it appears the code isn't using the source element even though the startPoint coordinates were automatically found from the element in the macro recording.

Is there anything that can be done to the code to have the points created on the source element??

Thanks


Viewing all articles
Browse latest Browse all 7260

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>