Correct structure for vba run Project module macro

Mirostation V8i series 3

I read Some information Jon had put up but I am not getting the name or the module or something correct

I have a file named Fillet.mvba in module 1 are the macros trying to run fillet005.

I have tried a number of combinations to no avail, I tried to copy from a previous question which had [Project Name] Module name macro name.

VBA RUN [projectName]moduleName.subProcedure clipped from the other answer. I am not getting something right

Example:

vba run [MyVBAProject]MyModule.MySubProcedure    

vba run [MyVBAProject]MySubProcedure

vba run fillet module1-fillet005

vba run [fillet]module-fillet.fillet-fillet005

vba run [fillet]fillet.fillet-fillet005

Parents Reply Children
  •  , I also appreciate this, but do not comprend the answer I have a file: Project Name =Fillet.MVBA the macro filename is Fillet050 how can I use the above information and these project and file names ? or am I misunderstanding

    your kind reply. Sorry a 41 yr, Master Electrician, self-taught Autocad, moved into the required job of converting to 

    micro-station in 1976, then into the V8i Series 3, been a real struggle. The most intutive program ever, with a group of

    such patient (for the most part)_ Kind, helpful folks. Helped me keep my  needed part time job. I use the funds to keep to Haitian children in school every year. An support other missions with the rest. Like life choices, folks in Mexico help build stairs and refurbish liking quarters . So a round of applauds to all of you for making this possible. and keeping me in a job. So thank you so much. Richard or RJB Phillips III Memphis, Tennessee USA.

    Version: MicroStation V8i SS 10

    RJB Phillips III (Richard) Praise the Lord for His Mercy and grace in Christ Jesus

  • Hi Richard. 

    Your filename must be Fillet.MVBA = Projectname. If Your Filename Filet.mvba, then you Projectname have a Title "Filet".  
    You can See your Projectname in Projectmanager. So you can change it and unload/load it.
    Dont forget please a Modulname. With Modulname "mod1Haupt" your Key-In must be so: 

    vba run [Fillet]mod1Haupt.Fillet

  • When I use Project manager, I can load Fillet.mvba

    When I use the feature to run macros, yes it comes up with

    Project Fillet Macros and one of the names listed is Fillet050

    then selecting edit I get the following

    Sub Fillet050()
    ' 012913 - Tested w/Message Box, from Key-in worked            5                             BBE

    '   Start a command
        CadInputQueue.SendCommand "DMSG ACTIVATETOOLBYPATH RJBP_B2\Construct Circular Fillet"

    '   Set a variable associated with a dialog box
        ActiveSettings.CoordinateAccuracy = msdAccuracy2
        SetCExpressionValue "tcb->fillet_radius", (ActiveModelReference.UORsPerMasterUnit * 0.5), ""
        SetCExpressionValue "tcb->msToolSettings.fillet.truncation", 2, ""
        ' CadInputQueue.SendCommand "FILLET ICON"
        CadInputQueue.SendKeyin "m,ms        Fillet Angle Set to 0.50"
        
    End Sub

    sorry to be dense. If I want to key-in the vba run and the config file already has the correct path. With the file unloaded would you if possible give me the exact way the key-in line should appear. I can learn from there on other projects. My RJBP.MVBA became so long I cut out some sections and saved then in other project file names. than my Icon tools which are Key-in VBA RUN Fillet050 and so on failed.

    vba run [Fillet]mod1Haupt.Fillet, won't this need a little more specific information to work. the macro names are Fillet050,  025, 0125 and so on. I sincerely appreciate, but do not see how [fillet]mod1haupt.,fillet will run the the specific macro. I am assuming if a project had module1, 2, 3, 4 you could substitute mod1 with2 My main VBA is RJBP.MVBA and I split it into various modules last night trying another way to solve my situation. Jan has made it clear I do not know the correct terminology so makes things harder to help. But you seem to understand this one. I am having trouble Forgive and sorry. is there a way to share this link on this subject with a friend. I do not even know how to do that. I can in goggle because it is displayed and I copy (c; ok til you replay thank you God bless

    Version: MicroStation V8i SS 10

    RJB Phillips III (Richard) Praise the Lord for His Mercy and grace in Christ Jesus

  • Hi Richard,

    unfortunately and as usually too many topics discussed in a form of lenghty text and not in e.g. as "a paragraph / bullet per issue" format. So just a few comments:

    ActiveSettings.CoordinateAccuracy = msdAccuracy2

    Why do you want to set model "accuracy" as a part of calling Construct Circular Fillet tool? It makes no sense at all. The accuracy, which is btw wrong term used for the whole history of MicroStation, defines how coordinates are displayed (how many digits). It means it has not any influence how the fillet tool works.

    SetCExpressionValue "tcb->fillet_radius", (Active

    Do not use tcb when it not really (really really) required! Your code is an example where better (more standard) solution is available. Do you know what TCB is and when it should be used and why not? Or it's something you copy-paste from some older discussion (because TCB were used often in MicroStation/J and older versions)?

    A standard way, how to define tools parameters (available I guess for 10 years already) is "set item toolsettings" key-in. There are some exceptions when it cannot be used or it's not supported by a specific tool, but they are minor and rare.

    In your case the key-ins are:

    set item toolsettings filletradius=<value>
    set item toolsettings fillettruncation=<0|1|2>

    for example:

    set item toolsettings filletradius=2.0
    set item toolsettings fillettruncation=2

    SetCExpressionValue "tcb->fillet_radius", (ActiveModelReference.UORsPerMasterUnit * 0.5), ""

    To use UORsPerMasterUnit value looks quite weird to me, because it's something that is used very rarely in MicroStation VBA. I assume I do not know the context well enough.

    In summary, it seems to me that it would be better to create own tool, to store it in DGNLIB, which is a standard approach, and to call the tool using key-in when necessary ... without any VBA code.

    With regards,

      Jan