<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://communities.bentley.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Pen Table Macro Hook help?!?</title><link>https://communities.bentley.com/products/microstation/microstation_printing/f/printing-and-plotting-forum/53902/pen-table-macro-hook-help</link><description>We are trying to write our first Macro for use with our Pentable. What we want to do is have the pen table &amp;quot;Drop element&amp;quot; based on criteria established, the print the element then undo the &amp;quot;drop element&amp;quot; to return it to it original status. So we started</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Pen Table Macro Hook help?!?</title><link>https://communities.bentley.com/thread/312842?ContentTypeID=1</link><pubDate>Mon, 02 Feb 2015 07:53:52 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:2783d6e1-e9c4-4b51-b35b-85504117b3e9</guid><dc:creator>Lorys</dc:creator><description>&lt;p&gt;This thread really belongs to programing forum..&lt;/p&gt;
&lt;p&gt;but in any case I&amp;#39;m curious why do you need to drop anything for printing .. cant your pentable correct things that dont print the way yuo want &amp;nbsp;normally?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pen Table Macro Hook help?!?</title><link>https://communities.bentley.com/thread/312207?ContentTypeID=1</link><pubDate>Mon, 26 Jan 2015 14:08:38 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:5adcc97e-6749-48d0-96b6-fc4ee126b91b</guid><dc:creator>David Schnelle</dc:creator><description>I found an easier method to hook a BASIC macro to the pen table, similar to the former response:  In your pen table, add something like this:&lt;br /&gt;
&lt;br /&gt;
BEGIN DropElementFunction&lt;br /&gt;
  BASICFUNC = DropElementFromPenTable.bas, DropElements&lt;br /&gt;
  PRIORITY = 30&lt;br /&gt;
END&lt;br /&gt;
&lt;br /&gt;
Where, DropElementFunction is only a name, there is nothing else associated with it.&lt;br /&gt;
DropElementFromPenTable.bas is a basic macro that contains the DropElements function that you want performed at plotting.  Note that your basic macro must contain a sub main().  Commands in the sub main() will be run prior to the function being called so you can have some pre-processing done, including calling other functions.&lt;br /&gt;
&lt;br /&gt;
The Hook Function is in the BASIC macro Editor.  While editing your BASIC macro, from the Edit pull down menu select &amp;quot;Program Entry Point&amp;quot;, click new and choose the type of Hook you need and insert your function name in the dialog box.&lt;br /&gt;
&lt;br /&gt;
It is my understanding that you cannot use VBA as your macro from the pen table, it must be in BASIC.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Re: Pen Table Macro Hook help?!?</title><link>https://communities.bentley.com/thread/128161?ContentTypeID=1</link><pubDate>Mon, 17 May 2010 02:26:42 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:8c1fc674-3472-4f53-ada0-19ad1f910089</guid><dc:creator>Roy Gallier</dc:creator><description>&lt;p&gt;I could not figure out how to&amp;nbsp;hook a VBA directly in my&amp;nbsp;thread, &lt;a href="http://communities.bentley.com/products/microstation/microstation_v8_2004_edition/microstation_v8_2004_edition_vba/f/164/p/16727/40539.aspx#40539"&gt;Emulate Plot Hook Functions &amp;amp; AutoRun&lt;/a&gt;. Although it is possible with a BASIC macro.&lt;/p&gt;
&lt;p&gt;Add a section to a PenTable to call the BASIC Macro:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;BEGIN Splash_Draw_Order&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BASICFUNC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = SPLASH_PenTableHook.bas,PenTableHook&lt;br /&gt;END&lt;/p&gt;
&lt;p&gt;Create a BASIC macro to call your primary macro (my &amp;quot;SPLASH_PenTableHook.bas&amp;quot; macro):&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Function PenTableHook (inElem as MbeElement) As Long&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim PenTableHookPoint&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; As String&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PenTableHook = MBE_ElemNormal&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;End Function&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Sub main&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim startPoint As MbePoint&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim point As MbePoint, point2 As MbePoint&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;#39;&amp;nbsp;&amp;nbsp; Send a keyin that can be a command string&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MbeSendKeyin &amp;quot;macro Splash_Draw_Order&amp;quot;&lt;br /&gt;End Sub&lt;/p&gt;
&lt;p&gt;Note that the &amp;quot;SPLASH_PenTableHook.bas&amp;quot; calls the &amp;quot;Splash_Draw_Order.ba&amp;quot; macro, this could also call a VBA macro.&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>