Author Topic: VBA in Microstation  (Read 9061 times)

0 Members and 1 Guest are viewing this topic.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
VBA in Microstation
« on: August 24, 2021, 03:09:52 PM »
Anybody doing VBA in Microstation?  I am trying to insert a DWG in a DGN, and i am super close, but cant find a few MS variables
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Re: VBA in Microstation
« Reply #1 on: August 24, 2021, 03:26:39 PM »
CmdrDuh?! Oh my, how have you been?


No to the VBA in Microstation but can I help you track them down? My VBA is super rusty and my Mirostation VBA is far worse.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: VBA in Microstation
« Reply #2 on: August 24, 2021, 03:30:14 PM »
I have been good.  Working in Dallas now, and loving it.


What I am trying to do (in Autocad speak) is insert a dwg inside the titleblock in modelspace.  What I need is to capture the min and max of modelspace so I can scale the incoming dwg to fit in the border.  Seems like this should be really easy, but I cant find anything in the object browser that will give me the extents of the design file
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Re: VBA in Microstation
« Reply #3 on: August 24, 2021, 04:14:51 PM »
I forgot that all of MS' docs are installed and not web based. But I did find a wiki that has some examples. The best I found so far is doing some of that on a small scale (one element scale).  Just wondering if you can build an array of elements and calculate the Range of that array (I doubt it, but I don't really have access to proper docs)? ...or just step through the array and locate the biggest/smallest X/Y value of each. Those min/max should be your extents?

https://communities.bentley.com/products/microstation/w/microstation__wiki/21861/calculating-the-range-of-rotated-cells
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: VBA in Microstation
« Reply #4 on: August 24, 2021, 04:17:37 PM »
I have found how to get my min/max, so now I can pick a point for lowerleft based on that value.  Now if I can figure out the dwg import piece.  Getting really close now
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)