Author Topic: AutoLISP with Microstation  (Read 9563 times)

0 Members and 1 Guest are viewing this topic.

wizman

  • Bull Frog
  • Posts: 290
Re: AutoLISP with Microstation
« Reply #15 on: April 04, 2021, 03:33:23 PM »
Please see the two links below regarding the linestyles (linetypes).
https://docs.bentley.com/LiveContent/web/MicroStation%20Help-v14/en/GUID-B4A2D2E6-0F9C-E61A-3953-339729FE67E4.html
https://communities.bentley.com/products/microstation/w/microstation__wiki/15269/saving-a-dgn-to-dwg-the-line-styles-are-not-displaying-correctly


Quote
MS is at first slow since it is tool based but the trick is to assign them as function keys.

My custom keyboard shortcuts in AutoCAD are numerical. I had them assigned to the Function key equivalents so there is no effort in switching between the two software.

Just an advice if you are used to having shortcut keys in AutoCAD.  In Microstation, you assign the shortcut keys to function keys F1 to F12.

Coder

  • Swamp Rat
  • Posts: 827
Re: AutoLISP with Microstation
« Reply #16 on: April 04, 2021, 04:03:36 PM »
Many thanks for your kind and important replies, I can't thank you enough.

Have a great day.

BIGAL

  • Swamp Rat
  • Posts: 1392
  • 40 + years of using Autocad
Re: AutoLISP with Microstation
« Reply #17 on: April 04, 2021, 06:34:07 PM »
The macro looks like the way to go if it writes VBA then lots can help it should be very similar to Autocad VBA.

Open MS and do a couple of macro's draw a
line 0,0 10,10
Circle 10,10 rad 20
Pline in Ms

Post them here would like to have a look.
A man who never made a mistake never made anything

Coder

  • Swamp Rat
  • Posts: 827
Re: AutoLISP with Microstation
« Reply #18 on: April 04, 2021, 06:40:26 PM »
The routines that I have for my AutoCAD are not a sequence of commands like scripts so there could be lots of vl-* and vlax-* functions and macros don't help at all in such circumstances.

wizman

  • Bull Frog
  • Posts: 290
Re: AutoLISP with Microstation
« Reply #19 on: April 04, 2021, 08:30:58 PM »
Many thanks for your kind and important replies, I can't thank you enough.

Have a great day.

I'm pretty sure you'll be up and running in no time. 
http://www.la-solutions.co.uk/content/CONNECT/MVBA/MVBA-Tips.htm

Credits to site owner.

Coder

  • Swamp Rat
  • Posts: 827
Re: AutoLISP with Microstation
« Reply #20 on: April 05, 2021, 04:47:02 AM »
I used to read that VBA language has been left behind and users going to .NET languages and also other than VB to any of C languages like C++, C# ... etc, so Am I going to be forced to learn VBA now to be able to code in MS? Ohh that is overwhelming indeed.

Thank you.

wizman

  • Bull Frog
  • Posts: 290
Re: AutoLISP with Microstation
« Reply #21 on: April 05, 2021, 06:07:45 AM »
I used to read that VBA language has been left behind and users going to .NET languages and also other than VB to any of C languages like C++, C# ... etc, so Am I going to be forced to learn VBA now to be able to code in MS? Ohh that is overwhelming indeed.

Thank you.

First is to learn the software first in 2D and 3D before diving into programming.  Familiarize with the program first.  Another to note again is that one dgn file can contain multiple modelspaces. I believe it has a lot more tools than AutoCAD.  That is why most of the needed automations are built-in already. Then  go for  scripting using series of key-ins in a notepad and recorded macros for automations. VBA is the easiest and is just the first step if you are coming from vba programming for AutoCAD and Excel.

If you know already the advanced languages, no need for vba.  More discussions and resources can be found in Bentley Communities and Bentley Learn.

Coder

  • Swamp Rat
  • Posts: 827
Re: AutoLISP with Microstation
« Reply #22 on: April 05, 2021, 07:08:02 AM »
The problem with Scripts and recorded macros is that I need to stick with commands and that's not what I want because I have some AutoLISP custom programs that don't use commands in them at all, so in this case I won't be able to load nor to run them on MS program.

I have not coded in VBA before and was about to start learning it a few years back but I have read lots of recommendations all over forums is that VBA is not going to continue and C languages would replace it in the next few coming years, besides that Autodesk disconnected VBA editor ( API ) from AutoCAD and users need to download it individually if they want to code in VBA with AutoCAD and that was another reason for me to stop thinking of VBA.

I am open to new ideas and for more discussions.


BIGAL

  • Swamp Rat
  • Posts: 1392
  • 40 + years of using Autocad
Re: AutoLISP with Microstation
« Reply #23 on: April 05, 2021, 08:38:55 PM »
Coder VL often refers to the VBA help so it is very similar syntax

Like Vla-get-layer is object.layer loops are more friendly you use arrays for lists that is pt(0) is x pt(1) is y pt(2) is z

I only dabble at the edges but there is heaps of examples out there when you google. Using VBA in excel means 1 language.

Post a lisp if some one has time will convert to VBA. On Autodesk Help lots of examples have VBA and Lisp code so can see the same result.

Just need some of the way MS expects object names etc.

A google
MicroStation VBA documentation ..\Bentley\MicroStation\MicroStationVBA.chm

This document is delivered with MicroStation. MicroStation VBA, the MicroStation V8 implementation of the Microsoft Visual Basic for Applications engine, one of the most popular programming environments in the world, provides MicroStation users (as well as developers) with a large number of capabilities -- from easy customization to tight integration with other Windows applications. In addition to identifying all the enums, objects, events, methods, properties, and types available, the MicroStation VBA documentation also includes a number of examples as well as a general overview covering the following:
A man who never made a mistake never made anything

Coder

  • Swamp Rat
  • Posts: 827
Re: AutoLISP with Microstation
« Reply #24 on: April 06, 2021, 07:12:35 AM »
Thank you.
I am waiting for the moment to start with MS then after that I can decide which way to take.

JohnK

  • Administrator
  • Seagull
  • Posts: 10595
Re: AutoLISP with Microstation
« Reply #25 on: April 06, 2021, 11:24:53 AM »
I used MicroStation for a few years and, it was very difficult to use/transition to. AutoCAD and MicroStation do a lot of things very differently.

Programming: the languages you choose depends on the platforms API and what you want to do or your level of programming knowledge. AutoCAD has an AutoLisp interpreter built in whereas MicroStation does not (thus, no AutoLisp in MicroStation).

C is a low level language so if you know C you can usually use/learn a higher level language like Lisp, VB(A), etc fairly easily.

Code generators/converters: I'm sorry but converting one language to another just doesn't work that way. Languages have different methods and uses for basic elements and there isn't a direct comparison.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Coder

  • Swamp Rat
  • Posts: 827
Re: AutoLISP with Microstation
« Reply #26 on: April 06, 2021, 12:02:27 PM »
Thank you John for your reply, that means a lot to me.

jvillarreal

  • Bull Frog
  • Posts: 332
Re: AutoLISP with Microstation
« Reply #27 on: April 06, 2021, 01:51:03 PM »
I have about 12 years experience with AutoCAD/Civil 3D and Microstation/Geopak; most recently OpenRoads Connect Edition.
If you've become accustomed to the command line in AutoCAD, there are a few options in Microstation to ease the transition.

-Customization of function keys (as mentioned)
-Position Mapping (Microstation's built in hotkeys)

If using any version before the "Connect Edition"
-Accudraw Shortcuts (These are limited to two key combinations, but can be mapped to any key-in or a script of key-ins)

-There should also be available utility delivered with Microstation called the Alias Manager (attached if not), where you can create shortcuts mapped to key-ins or scripts.
More info here:
https://communities.bentley.com/products/microstation/w/askinga/400/understanding-the-alias-manager

If you decide to use either the accudraw shortcuts or alias manager, you'll find it particularly helpful to use a customizable mouse for launching the alias manager
mdl or setting focus to the accudraw shortcut window.


If using Connect Edition:
It includes a built-in tool for creating shortcut key-ins.
It also includes a search bar on the top right that will help you launch a tool using keywords, which is extremely useful for beginners.

BIGAL

  • Swamp Rat
  • Posts: 1392
  • 40 + years of using Autocad
Re: AutoLISP with Microstation
« Reply #28 on: April 06, 2021, 08:04:58 PM »
To John is this backwards ?

"C is a low level language so if you know C you can usually use/learn a higher level language like Lisp, VB(A), etc fairly easily."

Like lisp 4 lines of code C is like 10 lines of code.

I still have the lisp2c converter but needs to run on like my 1st laptop its maybe 16 bit if any ideas how to run in windows 10 happy to try on code.

Had a quick look and one method the option NTVDM is not available.
« Last Edit: April 06, 2021, 08:26:03 PM by BIGAL »
A man who never made a mistake never made anything

Coder

  • Swamp Rat
  • Posts: 827
Re: AutoLISP with Microstation
« Reply #29 on: April 07, 2021, 03:38:16 AM »
Thank you jvillarreal for your inputs, that is surely very important to know.