can anybody help me in create a macro for placing solid sphere at active point (set by user) at varying co-ordinates?

I have a recorded the macro for fixed co-ordintates. I want to place sphere at active point set by user at various co-ordinates which will be variable. Please see the attached file for vba code for fixed co-ordinates.

Please see the attached video in the ppt file.  Can anybody help in creating macro for placing sphere at varying co-ordinates.

Presentation1 (1).pptx

  • Can anybody help in creating macro for placing sphere at varying co-ordinates

    First, write a VBA class that Implements IPrimitiveCommandEvents.  That will let you write a command that behaves like MicroStation's built-in tools.

    Second, use the SmartSolid object to create a sphere.  The sphere will be created at the origin, so you need to move (transform) it to the point provided by the IPrimitiveCommandEvents_DataPoint method.

    There are examples of IPrimitiveCommandEvents in MicroStation VBA help.  You may also find the examples here useful.

     
    Regards, Jon Summers
    LA Solutions

  • Hi Narayan,

    Please see the attached video in the ppt file.

    Seriously: No one with common sense will download unknown PPTX file, just to see whether video is inside. Except that it sounds like "see viruses inside the file I sent", why to use PowerPoint to share video? It makes no sense at all.

    If there is any video you would like to share (which is often efficient way to explain the problem), why to don't insert it directly to the page? There is Insert > Insert video/image/file tool available.

    Can anybody help in creating macro for placing sphere at varying co-ordinates.

    I agree with Jon that the way to go is to implement IPrimitiveCommandEvents. MicroStation VBA help contains several examples how to use this class and the examples is nearly "copy and use", so you can use them as a basic skeleton for our macro.

    One more note: Please read and follow MicroStation Programming Forum best practices. I am aware you tagged your post with many tags (some quite ugly and some incorrect), so based on them we can decide what product and version you use, but there are some recommendations what and how to share important information (they are valid for all BE Communities forums). To properly format the subject and to mention the information explicitely in the post text is better than to use many tags.

    With regards,

      Jan