<?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/"><channel><title>Paolo Maggiani's Activities</title><link>https://communities.bentley.com/members/e33c599d_2d00_94f1_2d00_4ad7_2d00_8c62_2d00_d47cbcc37d5e</link><description>Paolo Maggiani's recent activity</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>[v8i SS] Print color</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/193925/v8i-ss-print-color</link><pubDate>Mon, 16 Mar 2020 13:58:10 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:c638f673-645d-481b-bfe3-b02c8e1d9d6a</guid><dc:creator>Paolo Maggiani</dc:creator><description>&lt;p&gt;Hi veryone,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;next code prints in greyscale or true color&amp;nbsp; (I don&amp;#39;t know because I have B/W&amp;nbsp;printer):&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Sub Macro2()&lt;br /&gt; Dim startPoint As Point3d&lt;br /&gt; Dim point As Point3d, point2 As Point3d&lt;br /&gt; Dim lngTemp As Long&lt;/p&gt;
&lt;p&gt;&amp;#39; Start a command&lt;br /&gt; CadInputQueue.SendCommand &amp;quot;DIALOG PLOT&amp;quot;&lt;/p&gt;
&lt;p&gt;&amp;#39; Set a variable associated with a dialog box&lt;br /&gt;SetCExpressionValue &amp;quot;plotUI.uiColorMode&amp;quot;, 0, &amp;quot;PLOTDLG&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;#39;CadInputQueue.SendKeyin &amp;quot;PRINT MONOCHROME COLOR&amp;quot;&lt;/span&gt;&lt;br /&gt;&amp;#39;CadInputQueue.SendKeyin &amp;quot;PRINT MONOCHROME&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://communities.bentley.com/cfs-file/__key/communityserver-discussions-components-files/343173/SketchesPrinting.mvba"&gt;communities.bentley.com/.../SketchesPrinting.mvba&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;SetCExpressionValue &amp;quot;.uiNumCopiesToPrint&amp;quot;, 3, &amp;quot;PLOTDLG&amp;quot;&lt;/p&gt;
&lt;p&gt;CadInputQueue.SendCommand &amp;quot;PRINT MAXIMIZE&amp;quot;&lt;/p&gt;
&lt;p&gt;CadInputQueue.SendCommand &amp;quot;PRINT EXECUTE&amp;quot;&lt;/p&gt;
&lt;p&gt;CadInputQueue.SendCommand &amp;quot;PRINT EXIT PLOTDLG&amp;quot;&lt;/p&gt;
&lt;p&gt;CadInputQueue.SendCommand &amp;quot;MDL UNLOAD PLOTDLG&amp;quot;&lt;/p&gt;
&lt;p&gt;CadInputQueue.SendCommand &amp;quot;CHOOSE ELEMENT&amp;quot;&lt;/p&gt;
&lt;p&gt;CommandState.StartDefaultCommand&lt;br /&gt;End Sub&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I need a monochrome print.&lt;/p&gt;
&lt;p&gt;Some could help me, please?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I attached also .mvba.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks a lot.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Paolo&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>MicroStation VBA: OpenDesignFile vs. OpenDesignFileForProgram</title><link>https://communities.bentley.com/products/programming/microstation_programming/b/weblog/posts/microstation-vba-opendesignfile-vs-opendesignfileforprogram</link><pubDate>Mon, 31 Dec 2018 09:14:00 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:c7ca9c74-45c2-4e22-bcb5-6dc99cea3ca0</guid><dc:creator>Jon Summers</dc:creator><description>&lt;p&gt;A VBA programmer can open a DGN file using two methods: &lt;code&gt;OpenDesignFile&lt;/code&gt; and &lt;code&gt;OpenDesignFileForProgram&lt;/code&gt;.&amp;nbsp; This blog attempts to clear up confusion between the two, and which one to use.&lt;/p&gt;
&lt;h4&gt;&lt;span style="color:seagreen;"&gt;Prefer OpenDesignFile&lt;/span&gt;&lt;/h4&gt;
&lt;p&gt;Prefer &lt;code&gt;OpenDesignFile&lt;/code&gt; to &lt;code&gt;OpenDesignFileForProgram&lt;/code&gt;!&amp;nbsp; &lt;code&gt;OpenDesignFile&lt;/code&gt; opens a DGN file in the same way that a user would open a DGN file. Everything you expect to be available is available: level libraries, text styles, reference attachments and so on. When you create a new element, for example, it uses the active symbology.&amp;nbsp; You can add your new element to the active DGN model.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;MicroStation automatically resolves dependencies in the active DGN file.&amp;nbsp; Dependencies involve much of MicroStation&amp;#39;s sub-strata, such as patterns, text fields, tags etc.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;OpenDesignFile&lt;/code&gt; lets your code operate in an environment that&amp;#39;s identical to a file opened by a user.&amp;nbsp; What&amp;#39;s not to like?&lt;/p&gt;
&lt;h4&gt;&lt;span style="color:seagreen;"&gt;Use OpenDesignFileForProgram with care&lt;br /&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;p&gt;That method is used when you want to work with the contents of a DGN file &amp;#39;behind the scenes&amp;#39;.&amp;nbsp; It&amp;#39;s probably best to use it to query a DGN file rather than attempt to modify it.&amp;nbsp; When you &lt;code&gt;OpenDesignFileForProgram&lt;/code&gt; it does not expose the same data as &lt;code&gt;OpenDesignFile&lt;/code&gt;.&amp;nbsp; For example, level libraries and text styles are not available; no reference attachments are made.&amp;nbsp; Before you can create a new element, you have to attach the right level library; before you conjure a text element, you must ensure that the text style libraries are available.&amp;nbsp; If you want to work with reference attachments, you must first ensure the the reference cache is loaded.&amp;nbsp; You must write extra code to accomplish what MicroStation does normally.&lt;/p&gt;
&lt;p&gt;A DGN file opened by &lt;code&gt;OpenDesignFileForProgram&lt;/code&gt; does not activate MicroStation&amp;#39;s dependency engine.&amp;nbsp; The dependencies between DGN elements and meta-objects such as patterns, text fields, tags etc will not be resolved.&lt;/p&gt;
&lt;h4&gt;&lt;span style="color:seagreen;"&gt;Misunderstandings&lt;/span&gt;&lt;/h4&gt;
&lt;p&gt;Some developers think that, because &lt;code&gt;OpenDesignFileForProgram&lt;/code&gt; ends with &lt;code&gt;Program&lt;/code&gt;, it&amp;#39;s a better choice.&amp;nbsp; It isn&amp;#39;t.&amp;nbsp; &lt;code&gt;OpenDesignFile&lt;/code&gt; is always the best choice. &lt;code&gt;OpenDesignFileForProgram&lt;/code&gt; opens a file, yes &amp;mdash; but is that open file in some way better for programmers to use?&amp;nbsp; No!&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s what VBA help says about &lt;code&gt;OpenDesignFileForProgram&lt;/code&gt;: &lt;cite&gt;&lt;span style="color:seagreen;"&gt;Opens a DesignFile that the program controls. The user does not have access to the DesignFile except via the program that calls OpenDesignFileForProgram&lt;/span&gt;&lt;/cite&gt;.&amp;nbsp; In other words, a user can&amp;#39;t see anything that you do using &lt;code&gt;OpenDesignFileForProgram&lt;/code&gt; unless you explicitly reveal it to your user.&amp;nbsp; Probably the best use of &lt;code&gt;OpenDesignFileForProgram&lt;/code&gt; is to read information from another DGN file.&lt;/p&gt;
&lt;h4&gt;&lt;span style="color:seagreen;"&gt;Performance Fallacies&lt;/span&gt;&lt;/h4&gt;
&lt;p&gt;Some programmers argue for performance: &lt;code&gt;OpenDesignFileForProgram&lt;/code&gt; is in some way faster than &lt;code&gt;OpenDesignFile&lt;/code&gt;.&amp;nbsp; It&amp;#39;s not clear how a programmer justifies that argument.&amp;nbsp; It&amp;#39;s true that &lt;code&gt;OpenDesignFile&lt;/code&gt; initialises the DGN file in MicroStation, and ensures that level libraries, text styles and other resources are available.&amp;nbsp; It&amp;#39;s true that &lt;code&gt;OpenDesignFile&lt;/code&gt; opens and attaches all references.&amp;nbsp; All that takes time.&amp;nbsp; But, in most cases, that is exactly what you &amp;mdash; the programmer &amp;mdash; wants.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Before you assert that lack of performance is a problem, consult your users and measure!&amp;nbsp; Analyse your code: there may be some critical procedures that are performance hogs.&amp;nbsp; Attention paid to critical sections &amp;mdash; often &lt;em&gt;Do&lt;/em&gt; loops and &lt;em&gt;For&lt;/em&gt; statements &amp;mdash; can make a discernible improvement to execution times. If performance remains a critical issue, and you think that &lt;code&gt;OpenDesignFileForProgram&lt;/code&gt; offers an advantage over &lt;code&gt;OpenDesignFile&lt;/code&gt;, then you should expand your programming horizons.&amp;nbsp; Microsoft designed VBA to be a &lt;em&gt;rapid application development&lt;/em&gt; (RAD) tool, not a high-performance computing environment.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Once you know that your code&amp;#39;s functionality is correct, then think about performance.&amp;nbsp; Who thinks that performance is a problem?&amp;nbsp; If it&amp;#39;s only you, then there isn&amp;#39;t a problem.&amp;nbsp; Are your users complaining of slow execution speeds?&amp;nbsp; However slow your code is, it&amp;#39;s still hundreds of times faster than performing the same task manually.&amp;nbsp; If your code does what it&amp;#39;s supposed to do, then there&amp;#39;s no need to improve its performance until your users start to ask for higher productivity.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;A slow program that gives correct results is better than a fast program that behaves erratically.&amp;nbsp; Use VBA as a prototyping tool.&amp;nbsp; When lack of performance becomes an issue, move to a faster implementation: a DLL built from C++ source code will be substantially faster than anything you can create using VBA.&amp;nbsp; With MicroStation CONNECT you also have C# as an option.&amp;nbsp; While not as fast as a compiled C++ app., C# nonetheless offers much better execution times than VBA.&lt;/p&gt;
&lt;h4&gt;&lt;span style="color:seagreen;"&gt;Summary&lt;/span&gt;&lt;/h4&gt;
&lt;p&gt;I wrote this blog article to give you a single commendation: Prefer &lt;code&gt;OpenDesignFile&lt;/code&gt; to &lt;code&gt;OpenDesignFileForProgram&lt;/code&gt;!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>[V8i SELECTseries 3 VBA] IncludeOnlyWithinRange</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/213059/v8i-selectseries-3-vba-includeonlywithinrange</link><pubDate>Sun, 25 Apr 2021 18:10:17 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:bfa65968-0e6d-4c8d-b6b0-7d18a771dcec</guid><dc:creator>Paolo Maggiani</dc:creator><description>&lt;p&gt;Good evening,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;please see attached files, module: smartDim, sub: Dimension.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If I&amp;nbsp;include&amp;nbsp;IncludeOnlyWithinRange I get no element!&lt;/p&gt;
&lt;p&gt;Why?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks a lot,&lt;/p&gt;
&lt;p&gt;Paolo&lt;a href="https://communities.bentley.com/cfs-file/__key/communityserver-discussions-components-files/343173/SketchesPrinting-2021.04.21-_2D00_-WIP-TO-DIM.mvba"&gt;communities.bentley.com/.../SketchesPrinting-2021.04.21-_2D00_-WIP-TO-DIM.mvba&lt;/a&gt;&lt;a href="https://communities.bentley.com/cfs-file/__key/communityserver-discussions-components-files/343173/SLS180_2D00_62-.dgn"&gt;communities.bentley.com/.../SLS180_2D00_62-.dgn&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Copy from 3D model and Paste to a 2D</title><link>https://communities.bentley.com/products/microstation/f/microstation-forum/211580/copy-from-3d-model-and-paste-to-a-2d</link><pubDate>Wed, 24 Mar 2021 10:35:46 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:6b837de1-6987-40a6-83fb-cafe1939a662</guid><dc:creator>Paolo Maggiani</dc:creator><description>&lt;p&gt;Hi to everyone,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;please see the video you find here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://wetransfer.com/downloads/61f22df8527e1243a9909c227039dc5920210324103437/2c040bd9426633a17671143d8125d86520210324103510/a936d7"&gt;wetransfer.com/.../a936d7&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When I paste, left or front &amp;quot;elements&amp;quot; copied from a 3d model to a 2d model I obtain the top elements. Why?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Bye bye&lt;/p&gt;
&lt;p&gt;Help, please.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>[VBA] [V8i] Add Model from source dgn</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/202583/vba-v8i-add-model-from-source-dgn</link><pubDate>Tue, 01 Sep 2020 08:09:33 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:e8cb9ca6-5729-4029-8039-a84241a8893a</guid><dc:creator>Paolo Maggiani</dc:creator><description>&lt;p&gt;Good morning everyone,&lt;/p&gt;
&lt;p&gt;is it possible add a model (existing in a &amp;quot;source&amp;quot; DGN) as model in a &amp;quot;target&amp;quot; DGN?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I mean with original content.&lt;/p&gt;
&lt;p&gt;If yes, how?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Bye,&lt;/p&gt;
&lt;p&gt;Paolo&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>[v8I - VBA] Select element(s) in a reference</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/199136/v8i---vba-select-element-s-in-a-reference</link><pubDate>Fri, 19 Jun 2020 15:28:52 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:53088974-2f21-4360-a8f6-ebb49aea3187</guid><dc:creator>Paolo Maggiani</dc:creator><description>&lt;p&gt;Hi guys,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I want select all elements (and only them) in a level of a referenced file.&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;myFilter.ExcludeAllLevels&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;myFilter.ExcludeAllTypes&lt;br /&gt;&lt;br /&gt; myFilter.IncludeLevel ActiveModelReference.Levels(myLevel.Name)&lt;br /&gt; Set myCellElement = ActiveModelReference.Attachments(ModelName).Scan(myFilter)&lt;/p&gt;
&lt;p&gt;&amp;quot;&lt;span&gt;myFilter.IncludeLevel ActiveModelReference.Levels(myLevel.Name)&amp;quot; gives an error&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;How can I select all elements (and only them) of a level in a reference?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks and bye.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Paolo&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>[V8i - VBA] ScanCriteria &amp;quot;flow&amp;quot;</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/198888/v8i---vba-scancriteria-flow</link><pubDate>Mon, 15 Jun 2020 19:03:17 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:45645532-632c-4b17-b531-e677fe41ff92</guid><dc:creator>Paolo Maggiani</dc:creator><description>&lt;p&gt;Good evening people :-)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Do you know how ScanCriteria works?&amp;nbsp; In which way ScanCriteria finds out elements in the space? Can I (code) drive the&amp;nbsp;&amp;quot;scan&amp;quot; through the space?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I am going to (try to) explain myself.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;For example, I hava a 3D dgn file where, in the Default model, same level, I have 3 &amp;quot;lines&amp;quot; of pipes.(separate and casually arranged in space)&lt;/p&gt;
&lt;p&gt;Each line has two or more pipes. Each pipe is a cell.&lt;/p&gt;
&lt;p&gt;My aim is fill &amp;quot;Description&amp;quot; field of CellElement with a progressive ID; first one is given by user.&lt;/p&gt;
&lt;p&gt;Each pipe of the same line has to have a continuous ID.&lt;/p&gt;
&lt;p&gt;For example: if Line 1 has 3 pipes and the starting ID is &amp;quot;AA-021&amp;quot;, first pipe will be named &amp;quot;&lt;span&gt;AA-021&amp;quot;, 2nd &amp;quot;AA-022&amp;quot; and 3rd &amp;quot;AA-023&amp;quot;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Using ScanCriteria, I got an ElementEnumerator filled with right elements (in this case, cells) but in a order apparently random.&lt;/p&gt;
&lt;p&gt;So the naming appears randomly and without a sense: for example: for Line 1 I could have first pipe named &amp;quot;&lt;span&gt;AA-021&amp;quot;, 2nd &amp;quot;AA-024&amp;quot; and 3rd &amp;quot;AA-027&amp;quot;. And&amp;nbsp;&amp;quot;AA-022&amp;quot; is given to a pipe of Line 2 and may&amp;nbsp;&amp;quot;AA-023&amp;quot; is given to Line 3....&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Any suggestions?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks a lot.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Bye,&lt;/p&gt;
&lt;p&gt;Paolo&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>[V8i - VBA] CopyElement problems</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/198460/v8i---vba-copyelement-problems</link><pubDate>Sun, 07 Jun 2020 08:29:56 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:65a31406-451b-4296-af99-2c079fc04d65</guid><dc:creator>Paolo Maggiani</dc:creator><description>&lt;p&gt;Good morning friends,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;in a 3D model, I have some 3D objects (Cells).&amp;nbsp; I did &amp;quot;Visible Edge Export&amp;quot; of each of them on the XY, XZ and YZ planes. And then Flatten Curve.&lt;/p&gt;
&lt;p&gt;My desire is to copy each of these cells (They are cells because the lines obtained with Flatten Curve have been grouped - GROUP SELECTION command)&amp;nbsp;from&amp;nbsp;the 3d model of source&amp;nbsp;Dgn to a target Dgn (2D model) using&amp;nbsp;OpenDesignFileForProgram.&lt;/p&gt;
&lt;p&gt;I read in the Microstation VBA Help that, with&amp;nbsp;OpenDesignFileForProgram, is not possible make use of AddElement (is it correct?).&lt;/p&gt;
&lt;p&gt;Then I utilised&amp;nbsp;CopyElement, but I got some problems:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;1. CellElements are 100 times greater (Both files, source and target, have the same working unit and active scale is set to 1 for x, y and z)&lt;/p&gt;
&lt;p&gt;2. I got, in the target file, only one cell for each originary 3D cells in the right &amp;quot;persective&amp;quot; (please see the attached image) : top and left are wrong.&lt;/p&gt;
&lt;p&gt;3. Cells Position, in the target file are not the asked ones (I suspected this problem could be linked to n.1 problem)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I tried to do a lot of attempts to solve those problems, without luck...&lt;/p&gt;
&lt;p&gt;I insert the last one here (where I also added cells to source file too, to see if AddElement (Instead of CopyElement) works well...and all was right).&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Sub CopyToSmartSketch()
    Dim myDgn As DesignFile
    Dim myCopyContext As New CopyContext
    
    ActiveDesignFile.Models(&amp;quot;Default&amp;quot;).AddElement myCellToExchange
    
    Set myDgn = OpenDesignFileForProgram(&amp;quot;C:\Users\Paolo\Desktop\Celle\smartSketch.dgn&amp;quot;, False)
    
    myCopyContext.ChangeUnits = True
    myCopyContext.MatchDimensionToDestination = True
    myCopyContext.LevelHandling = msdCopyContextLevelByUserPreference
    myCopyContext.ViewForFlattening = myPlane
    
    myDgn.Models(&amp;quot;Default&amp;quot;).CopyElement myCellToExchange, myCopyContext
    
    myCellToExchange.Origin.X = myOriginX
    myCellToExchange.Origin.Y = myOriginY
    
    myCellToExchange.Rewrite
    myCellToExchange.Redraw
    
    myDgn.RewriteLevels
    myDgn.Save
    myDgn.Close
End Sub
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/343173/3073.Cattura.JPG" /&gt;&lt;/p&gt;
&lt;p&gt;I searched on the web: I found a LA Solution to copy objects from 3D model to a 2D one, but (I didn&amp;#39;t try it) I would like to write my own one.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks a lot.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&amp;nbsp;&lt;br /&gt;Paolo&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>[V8i - VBA] Get active level</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/198440/v8i---vba-get-active-level</link><pubDate>Sat, 06 Jun 2020 12:20:09 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:facc2d34-c40e-4362-8b6f-fcab55a594c3</guid><dc:creator>Paolo Maggiani</dc:creator><description>&lt;p&gt;Hi guys,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;is tahat the only (and better) way to get the active level?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;    Dim myModel As ModelReference
    Dim myLevel As Level
    
    Set myModel = ActiveModelReference
    
    For Each myLevel In myModel.Levels
        If myLevel.IsActive = True Then
            ... ...
        End If
    Next
...
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;P&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>[V8i - VBA] Pass array from one dgn to another</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/198308/v8i---vba-pass-array-from-one-dgn-to-another</link><pubDate>Thu, 04 Jun 2020 06:57:05 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:27f43a44-d8e6-4fd2-b360-0c93ec8885e2</guid><dc:creator>Paolo Maggiani</dc:creator><description>&lt;p&gt;Good morning,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I would like to copy some cells from one dgn to another, starting from a particular point, in the target file, chosen by the user.&lt;/p&gt;
&lt;p&gt;I thought of linking this functionality to a command button on a form. After pressing the button, the user is asked to indicate the starting point from which to start the copy of the cells.&lt;br /&gt;The idea is to populate an array (CellElements) in the source file and &amp;quot;make it available&amp;quot; in the target dgn.&lt;/p&gt;
&lt;p&gt;Is it a possible solution? If yes, how should I do it? If not, instead, what solution would you adopt?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks a lot.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Paolo&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Level off - IsDisplayedInView [VBA][V8i]</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/198001/level-off---isdisplayedinview-vba-v8i</link><pubDate>Fri, 29 May 2020 12:41:25 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:71db7ce0-ccef-4c77-be89-65ab398b6330</guid><dc:creator>Paolo Maggiani</dc:creator><description>&lt;p&gt;Hi guys,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I wrote this code, to set off all levels.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Sub AllLevelOff()
    Dim myLevel As Level
    Dim myLevels As Levels
    Dim myView As View
    Dim iViewIndex As Integer
    
    iViewIndex = 1
    Set myLevels = ActiveDesignFile.Levels
    
    Set myView = ActiveDesignFile.Views(iViewIndex)
    
    For Each myLevel In myLevels
        &amp;#39;MsgBox myView.Index
        &amp;#39;Dim str As String
        &amp;#39;str = myLevel.Name
        &amp;#39;Set myLevel = ActiveDesignFile.Levels(myLevel.Name)
        myLevel.IsDisplayedInView(myView) = False
        &amp;#39;myLevel.IsDisplayed = False
        &amp;#39;myLevel.IsFrozen = True
    Next myLevel
    myLevels.Rewrite
    RedrawAllViews
    
    Dim sPipeID As String
    sPipeID = &amp;quot;LO-001&amp;quot;
    ActiveDesignFile.Levels(sPipeID &amp;amp; &amp;quot; - 3D - Axis&amp;quot;).IsActive = True
End Sub&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;but it works only for Global display and Frozen, not for View display.&lt;/p&gt;
&lt;p&gt;I followed those articles/codes:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.la-solutions.co.uk/content/V8/MVBA/MVBA-LevelControl.htm"&gt;http://www.la-solutions.co.uk/content/V8/MVBA/MVBA-LevelControl.htm&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/microstation/w/microstation__wiki/2895/2895"&gt;https://communities.bentley.com/products/microstation/w/microstation__wiki/2895/2895&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I work around the problem using the isdisplayed property, but I ask why it shouldn&amp;#39;t work. Do you know anything about it?&lt;br /&gt;Now, I&amp;#39;ve seen an answer by Jon Summers in which he says, if I don&amp;#39;t get it wrong, that isdisplayedinview is only available from version 8.01 of VBA.&lt;/p&gt;
&lt;p&gt;But if so, why do I see the property among those available with Level objects? And anyway why doesn&amp;#39;t my code work?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you so much,&lt;br /&gt;Paolo&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Select All [VBA][V8i]</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/198017/select-all-vba-v8i</link><pubDate>Fri, 29 May 2020 17:35:48 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:dea8e992-2a48-4e39-b2d8-25940e75a5ff</guid><dc:creator>Paolo Maggiani</dc:creator><description>&lt;p&gt;HI everyone,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;CadInputQueue.SendCommand &amp;quot;CHOOSE ALL&amp;quot; and scan criteria are the only ways to select all elements in a level, aren&amp;#39;t?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Bye,&lt;/p&gt;
&lt;p&gt;Paolo&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Invert Selection  [VBA] [V8i]</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/197960/invert-selection-vba-v8i</link><pubDate>Thu, 28 May 2020 21:34:50 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:a14e4655-ebd1-4305-b7da-76f3cad9a52a</guid><dc:creator>Paolo Maggiani</dc:creator><description>&lt;p&gt;Good morning,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I would like to select the unselected elements and, vice versa, deselect the selected ones.&lt;/p&gt;
&lt;p&gt;Is it possible, and, if yes, how?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks a lot,&lt;/p&gt;
&lt;p&gt;Paolo&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Interacting with Visible Edges Dialog Box [V8i] [VBA}</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/197703/interacting-with-visible-edges-dialog-box-v8i-vba</link><pubDate>Sat, 23 May 2020 17:43:56 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:477c4d76-1f5a-438e-a77b-ca5b3c81f066</guid><dc:creator>Paolo Maggiani</dc:creator><description>&lt;p&gt;Good evening,&lt;/p&gt;
&lt;p&gt;I&amp;#39;d like to interact with&amp;nbsp;Visible Edges Dialog Box.&lt;/p&gt;
&lt;p&gt;I wish to set several parameters as&amp;nbsp;view, boundary, output file, method,&amp;nbsp;attributes for Visible and Hidden edge, etc.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I have to implement IModalDialogEvents in a class module and use AddModalDialogEventsHandler before use CadInputQueue.SenCommand &amp;quot;MDL COMMAND EDGE EXPORT&amp;quot; in the module&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In the IModalDialogEvents_OnDialogOpened,&amp;nbsp;I don&amp;#39;t know the syntax to set parameters on the&amp;nbsp;Visible Edges Dialog Box&lt;/p&gt;
&lt;p&gt;I tried searching on Microstation VBA Help and on the web without any results&lt;/p&gt;
&lt;p&gt;So I reorded a macro exporting visible edge, but I obtained&amp;nbsp;SetCExpressionValue&lt;/p&gt;
&lt;p&gt;Where&amp;nbsp;can I find that sintax? Can yo help me?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks a lot.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Paolo&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>[VBA] [SS3] CreateLineElement2; CreateEllipseElement2; CreateTextElement1; CreateCellElement1</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/195876/vba-ss3-createlineelement2-createellipseelement2-createtextelement1-createcellelement1</link><pubDate>Mon, 20 Apr 2020 18:42:51 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:1b48df5c-4644-40c6-887e-4cf9606f1d14</guid><dc:creator>Paolo Maggiani</dc:creator><description>&lt;p&gt;Good evening,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I am making some attempts to write code to practice VBA for MS. I have found many code examples on several sites and in many cases they call the following procedures:&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;CreateLineElement2 (myElement as Element, StartPt as Point3d, EndPt as Point3d) as LineElement;&lt;br /&gt;CreateEllipseElement2 (Nothing; CenterPoint, 0.5, 2, myMatrix);&lt;br /&gt;CreateTextElement1 (Nothing; &amp;quot;Example&amp;quot;, myText, myMatrix);&lt;br /&gt;CreateCellElement1 (&amp;quot;NewCell&amp;quot;; myLine, PositionPt).&lt;/p&gt;
&lt;p&gt;I have not understood if these procedures are &amp;quot;standard&amp;quot; and therefore already present in the VBA Microstation code by activating some additional component.&lt;br /&gt;Could anyone please help me?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks a lot.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Paul&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>