[quote userid="966590" url="~/products/programming/microstation_programming/f/microstation-programming---forum/175441/tracking-time-to-open-design-files"]it is not working[/quote] Well, we can't deduce much from that! What do you mean by 'not working'? Does your code compile? If it does compile, what happens or doesn't happen when you run your code? Put a few debug statements in there to test your assumptions. For example … Sub TestTimeTrack() Set TimeTrack = New clsTimeTrack AddModelActivateEventsHandler TimeTrack Debug.Print "Create handler TimeTrack" End Sub File name "F:\IOP\EW\02_Plant\99_CAD\Dev\VBA\TimeTrack.txt" is repeated several times. That's a recipe for inconsistency and creeping bugs as you develop your code. Prefer to pass the file name to a subroutine rather than repeat its definition. Define a constant variable that defines the file name once … Const LogFileName As String = "F:\IOP\EW\02_Plant\99_CAD\Dev\VBA\TimeTrack.txt"
↧
Forum Post: RE: Tracking time to open design files
↧
Forum Post: RE: [Connect u11 any language] Constructing elements volume box
Hi, To compute a 3d Convexhull in C#, I am using https://github.com/DesignEngrLab/MIConvexHull . For C++ you could look at https://www.geometrictools.com/Samples/Geometrics.html . If the shrink wrapping tool (https://communities.bentley.com/products/microstation/b/microstation_blog/posts/shrinkwrapper-tool---new-tech-preview-feature-in-microstation-connect-edition-update-8) could be used per api (I don't know or found anything), you could use that to 'heal' your element. Regards Harrmen
↧
↧
Forum Post: RE: How to check whether the Cell is copied from another cell, or how to check two Cells has the same geometries?
thanks Jan for the reply, yes, a shared Cell works in this case, where there is a shared definition. for normal cells, maybe as you said, hard to tell whether they are identical.
↧
Forum Post: RE: How to use the timer in MicroStation CONNECT Edition?
It's impossible to use 32-bit controls in 64-bit VBA.
↧
Forum Post: [CONNECT C++] WhereCriterion test for Boolean Property value
I can successfully test an Item Type property that holds a string value, using for example WhereCriterion::CreateStringFilter . I don't see a similar function for Boolean properties, although there is WhereCriterion::CreateNumberFilter for numeric properties. How do I create a WhereCriterion for a Boolean property value? Should I use CreateNumberFilter and pass 0|1 obtained from the Boolean value?
↧
↧
Forum Post: RE: [v8i VBA] Seemingly random propertyHandler failures
Thank you! I did not read carefully enough to see that GetVertices has a defined order, so I will prefer that and VerticesCount in the future.
↧
Forum Post: RE: selection of cells and processing
Hi Massimo, Can you explain further why you want to select cell 1 and then cell 2? I think you can simplify the command if you select and process one cell and then start the command again to select and process the next cell. For now, I recommend you try to write your command so that it will select and then do a simple task like return the cell name. Once this is working, extend the command to read the tags on a cell. The Analyze Arc Example in the MicroStation VBA Help file is a good place to start. And make sure the ILocateCommandEvents code is in a "class" file and the macro sub that calls it is in a module file. Regarding your code: I noticed that Implements ILocateCommandEvents is called two times. The first thing to do is to remove one of these. I would remove the Implements ILocateCommandEvents at line 39. When you do this, the command will compile. I recommend you comment out the code inside readtag and replace it with something simple like a Debug.Print "Got the cell!" - just something simple to make sure it works. Then you can tackle the read tag portion.
↧
Forum Post: RE: Run VBA on Startup not working
Would there be anything else stopping this from running? All of my other routines are just called from commands within MicroStation. There are no other events or anything that i know of.
↧
Forum Post: RE: selection of cells and processing
Hi Mark, [quote userid="86283" url="~/products/programming/microstation_programming/f/microstation-programming---forum/175445/selection-of-cells-and-processing/507231"] I think you can simplify the command if you select and process one cell and then start the command again to select and process the next cell. [/quote] If both cells are members of the same "transaction", to split the code into two commands is not good in my opinion. In a context of the same command, undo buffer and other settings are maintained properly automatically. When two commands will be created, they will be just two separate commands, not one. Regards, Jan
↧
↧
Forum Post: RE: selection of cells and processing
Hi Massimo, can you share an example how cells looks like? Are there any criteria what cell can be selected in the first and second step? It can make the code substantially different. Regards, Jan
↧
Forum Post: RE: [CONNECT C++] WhereCriterion test for Boolean Property value
will you like to try: WhereCriterionPtr wh = WhereCriterion::CreateComparison (*WhereExpression::CreatePropertyExpression (L"myBool"), WhereCriterion::EQ, *WhereExpression::CreateConstant (ECN::ECValue(true))); or WhereCriterionPtr testProp_IsTag = WhereCriterion::CreatePropertyComparison(L"IsTag", WhereCriterion::EQ, ECN::ECValue(true)); Thanks, Mangesh
↧
Forum Post: RE: selection of cells and processing
Goodmorning everyone I worked a little and I managed to do something I attach macro and dgn communities.bentley.com/.../celle.dgn communities.bentley.com/.../locate_5F00_cell.mvba
↧
Forum Post: RE: [CONNECT C++] TextBlock::SetStyleProperties
Bruce, Try this: DgnTextStylePtr textStyle = DgnTextStyle::Create(L"",*ISessionMgr::GetActiveDgnFile()); UInt32 color = 3; // Color flag textStyle->SetProperty (TextStyleProperty::TextStyle_ColorFlag, true); // Color flag textStyle->SetProperty(TextStyleProperty::TextStyle_Color, color); TextStylePropertyMaskPtr stylePropMask = TextStylePropertyMask::CreatePropMask(); // Color flag stylePropMask->SetPropertyFlag (TextStyleProperty::TextStyle_ColorFlag, true); // Color flag stylePropMask->SetPropertyFlag(TextStyleProperty::TextStyle_Color, true); CaretPtr startCaret = textBlock->CreateStartCaret(); CaretPtr endCaret = textBlock->CreateEndCaret(); textBlock->SetStyleProperties(*textStyle, *stylePropMask, *startCaret, *endCaret); textBlock->PerformLayout(); ITextEdit::ReplaceStatus rStatus = editor->ReplaceTextPart(eeh, *textPartId, *textBlock); // every time you replace, you get another ? eeh.ReplaceInModel(elemRef); Thanks, Ashrafali
↧
↧
Forum Post: Generate Mesh from Point Cloud (Ground Points) - V8i C++
Hi Team, Requirement : How to create Mesh from Point cloud data Programmatically (using MDL's C++ API) ? Manual Procedure : Currently i am creating Mesh using Microstation point elements (Tools -> Mesh -> Create Meshes -> Mesh from Points). I am using Microstation V8i SS4 - Version 08.11.09.829 with MDL's C++ API. Regards, B Daniel.
↧
Forum Post: RE: Generate Mesh from Point Cloud (Ground Points) - V8i C++
[quote userid="296547" url="~/products/programming/microstation_programming/f/microstation-programming---forum/175501/generate-mesh-from-point-cloud-ground-points---v8i-c"]How to create Mesh from Point cloud data Programmatically?[/quote][quote userid="296547" url="~/products/programming/microstation_programming/f/microstation-programming---forum/175501/generate-mesh-from-point-cloud-ground-points---v8i-c"]Currently i am creating Mesh using Microstation point elements (Tools -> Mesh -> Create Meshes -> Mesh from Points)[/quote] That begs the question: "What do you want to achieve programmatically that you can't already do with Tools|Mesh|Create Meshes|Mesh from Points ? Presumably you are asking about an algorithm to create a meaningful mesh? Those tools must perform some quite tricky spatial analysis to extract a meaningful mesh from a point cloud. Or, to put it another way, I'm sure that it's easy to create a meaningless mesh from a point cloud . I suggest that you search the web for ideas. Here are some that I found with a search for create mesh from point cloud ... Foundry: Creating a Mesh from a Point Cloud Stack Overflow: Create mesh from point cloud PCL: Fast triangulation of unordered point clouds
↧
Forum Post: RE: How to check whether the Cell is copied from another cell, or how to check two Cells has the same geometries?
Hi Jan, Yes, I certainly agree this could be a fine: a.) API enhancement, and b.) source code "diffing example" for inclusion in the SDK. Once MSCE SDK U12 goes out I will return to adding these to our backlog items. Thank you, Bob
↧
Forum Post: RE: How to check whether the Cell is copied from another cell, or how to check two Cells has the same geometries?
Hi Rick, MicroStation provides two related items/concepts that may also help with improving your confidence and standards further. Shared Cells (definition and instances). Similar to how reference files and display overrides work, but point to a master geometric definition. Standards Checker (way to create and test your standards against production data.) HTH, Bob
↧
↧
Forum Post: RE: Run VBA on Startup not working
Hi Robert, From what I read in this thread, I suspect one or more of your Project's source code files might not be compiling and producing "undefined behavior" often seen as "doing nothing". For your project source code please verify the following: All source files (Forms, Modules, Classes) have "Option Explicit" as the very first line of code. When Step #1 is complete, open the VBA Editor with your project selected and try to compile your project (Debug > Compile . If there are no problems compiling the project you will see no response from the VBA Editor. If however, there are (undetected problems), the Editor will be sure to provide hints on what is required to be fixed (as individual incremental errors to fix). Although I did not have a chance to look at Jon's project I did create a MicroStation VBA template project ( Search : MSVBAEvents.mvba ) that can be helpful in understanding and implementing VBA events and order executed. If you try and find this template example useful and would like to see any additional items added feel free to let me know and I will directly update that file linked above. HTH, Bob
↧
Forum Post: update userform
Microstation V8i(08.11.09.833 I have some public variables, declared in the main sub when I open userform I would like the variable text box to be updated. if I assign a button to update I have what I want I would like to do it without pressing update buttons. Is it possible in VBa? I hope I explained myself Load frmdati ' open userform frmdati.Show want to get what I get by pressing the button "Update" Private Sub update_Click() testoDistOrizz.Value = distanza_orizzontale ' textbox testoDistIncl.Value = distanza_inclinata ' textbox testoPendenza.Value = Pendenza 'textbox End Sub
↧
Forum Post: RE: update userform
[quote userid="2978" url="~/products/programming/microstation_programming/f/microstation-programming---forum/175520/update-userform"]Is it possible in VBa? [/quote] Your question is about VBA in general, not about MicroStation VBA in particular. VBA is provided by many apps. besides MicroStation, notably VBA for Microsoft Office. You will find plenty of help about VBA on the web. For example, The Excel VBA Initialize Form Event . There's also this book: Microsoft Excel 2016 Macro e VBA (Italian Edition)
↧