Hey all. I've run into a problem and I hope someone here can help me. I've got a macro written that places a cell and then automatically sets the tags. However, when I call CreateCellElement2(), I'm getting a run-time error with code -2147218383 (80040c31) and text "No such application".I searched online for that particular text, and sure enough, the first result was right here on this forum, from a few years back. But the person who made that posting never got an answer, they just settled for using key-ins. In my case, this process is designed to run multiple times, so key-ins aren't very attractive. Below is the code where I'm getting the error. For the record: ZP() is just an alias for Point3dZero. I've verified that the cellName var gets the correct cell name, that the correct cell library is attached, etc, etc.
'select which block
Dim cellName As String
cellName = Left(vp.cellName, Len(vp.cellName) - 3)
'set up and create the cell
Dim cellBlock As CellElement
Set cellBlock = CreateCellElement2(cellName, ZP(), Point3dOne(), True, Matrix3dIdentity())
'might need to specify the sheet name with activedesignfile.models(sheet name)
to understand your situation better I have a few questions:
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Jon Summers,I am unable to reply directly to your post, so please excuse my lack of quotations for clarity.
1) Yes, it works perfectly if the cell does not have a tag set. It also works perfectly in other VBA modules in which I have used that method. This particular module has Option Base 0 set, though when I tried removing that and reworking my arrays, it did not seem to help. There is, furthermore, a truly bizarre occurrence happening which I just noticed this morning which I will describe below.2) Yes, though it is defined through a DGN library. I have tried the code in a DGN file that has the tag set explicitly defined, and it produces the same error.
The Bizarre occurrence I mentioned is that I have found that if I run this module enough times (as would happen during debugging with a particularly intractable issue), MS will eventually strip all the tags and the tag set from the cell, replacing the tags with text elements containing the default value of the tag. I have tried this with several different cells, and it does it to all of them. I have no explanation for this, and have never seen anything like it.
On to your next questions, in answer to both: I have documentation for those methods in my help file, though ManipulateAsElement is listed as a property (a read/write boolean, to be precise). Jan Slegr,
Thank you for that. I will try to run the prerequisites installer again and see if that helps at all.
Darin Rodberg said:I will try to run the prerequisites installer again and see if that helps at all.
Can you share a capture of your Reference dialog (as I did) for VBA project you have problems with?
Maybe it will help somebody to investigate where the problem can be.
Darin Rodberg said:I have documentation for those methods in my help file
Well, your help is up to date. To test whether your VBA installation is also up to date, add some code that uses one of the later methods to your project, and see if the IDE complains. For example...
Sub VersionTest ()
' If VBA doesn't complain, then you're OK
Dim oSmartSolid As SmartSolidElement Set oSmartSolid = CreateCone (Nothing, 1.0, 1.5, 2.0)
Regards, Jon Summers LA Solutions
Jon Summers said:add some code that uses one of the later methods to your project, and see if the IDE complains.
I like this way! :-)
In MicroStation V8 2004 Edition that uses Bentley MicroStation DGN 8.0 Object Library, it ends with this error (because SmartSolidElement was introduced in V8i using DGN 8.9 Object Library):
Hopefully, the forums will post my response this time. The following is copied and pasted from an email I just sent to Jon Summers: I am Darin Rodberg, the member of the Bentley forums whom you and Jan Slegr have been attempting to help. I am unable to currently use the forums to post replies in any form, which is why I am sending you this email. I also cannot locate Jan’s email, as I get a 503 error whenever I try to access his blog or website. For the record, this appears to be a technical difficulty, as it is consistent across different browsers and different computers. I truly have never encountered such pervasive difficulties before with any software developer, to the point where I am currently researching whether or not there is malware of the “annoyanceware” variety directed at Bentley with which my computer may be infected. If you would be so kind, please inform Jan that my references are the same as his, except in terms of their priorities. I will modify those priorities and restart, to see if that helps. Please also accept and convey to Jan my gratitude for the help you two have been providing me. I’m quite sure my frustration comes through at the forums and in this email, but that frustration is exclusively directed at Bentley, their software developers, customer services and website. The members of the forum have been nothing but helpful to me. I will do so myself if and when I find the forums to be functional.
As a final note (this is no longer from the emai), I am capable of using vba to implement SmartSolids. It produces no error.
I am finally able to get the advanced reply editor to work. Here is the screenshot of my references dialog. Note that the "PCS_Tools" entry is a vba module which contains a few geometric functions, and a few aliased microstation functions, such as XY() for Point3dFromXY() and ZP for Point3dZero(). Only the two aliases I gave as examples are used in this module.
Also, I have a question: Does the title of this forum contain chinese characters for anyone but me?
Darin Rodberg said:Does the title of this forum contain chinese characters for anyone but me?
Yes, that is a puzzle. It's an image rather than character glyphs...
I usually use the other Programming Forum. I don't know why this one exists.
The image is one which I took with the snipping tool, but on the page header they are actual unicode Chinese characters:
Wrt to the other programming forum: This is the one I'm sent to when I choose "Developers and programming" from the list on the main page, then click "Microstation programming" at the next page.
Darin Rodberg said:1) V8i SS3 2) Yes, it's not being run through any other application. 3) I'm unsure why you say this, because without fail, if I do not call .Redraw, any element I create or modify using VBA does not appear or update on the screen
I too am puzzled about that. MicroStation V8i uses DirectX for graphics display. The display is 'self-healing' and doesn't require a redraw when something is added or changed. Including Element.Redraw in your code does no harm, but from MicroStation XM onwards has no effect. Thus, the fact that you need it indicates that something else is wrong.
When MicroStation finds that it can't use hardware-accelerated graphics, it falls back to software emulation of DirectX. That used to be a common complaint, but I haven't seen any reports of that in the past year or so.
1) Windows 7 Pro, SP1 2) NVIDIA GeForce GTX 950 (No, I didn't build these systems, the owner's son did. I've already explained the difference between gaming and workstation graphics cards to him, and he's going for the latter for all future builds, but we're stuck with these for now.) 3) Yes. I have no problems with DirectX. The GTX cards we use don't have any known issues working with any DirectX.