Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all 4331 articles
Browse latest View live

Connect Update 12 - VBA Projects not saving

$
0
0

It appears that if you create a new project then it saves fine, but if you try to work on the same project after you load it, then it becomes read only, although the file itself is not read only. Trying to saveas at this point will crash your microstation and you will loose all your work. Has this been reported?

Version 10.12.00.40


What does this mean - "??È" when referring to ModelName?

$
0
0

Some elements in my drawings are reporting "??È" as the ModelName. It looks corrupted, and trying to write that text into a text file will cause an error. Has anyone seen this?

[MS V8i SS3 VBA] Questions about ILocateCommandEvents

$
0
0

Hello All,

I'd like to know when my cursor was moved to the MS menu/toolbar/tasks, it seems ILocateCommandEvents_Dynamics works only when the cursor was inside the view(black part), is it possible to know if the cursor is moved on other parts(me menu/toolbar/tasks/etc, anywhere as soon as it is not black)? Or maybe other way in MVBA. Thanks a lot.

Automated quotes - Pipes

$
0
0

Good morning everyone! :-)


I wish to obtain pipes quotes automatically, as in the attached example. (Front, top and left view, for example.)

My idea is to get a joined line (chain) for the pipe's axis and, clicking it, obtain the quotes with a macro.

Anyone of us did it in the past? Or something similar? Could you kindly help me, please?

Thanks a lot.

Best regards,

Paolo

text change after editing

$
0
0

Dear Gentleman,

i want solution.

when i edit any text the output text is reducing with size ( height & width ).

for Example:  " ASSAD "  after editing it will come " ASSAD ".

[CONNECT C++] Setting up C++ Visual Studio Project problems

$
0
0

hoping someone might be able to help me out. I have been writing addins in C#, but now im trying to start out with using c++/Cli for some wrappers. but I'm getting errors from the start...

here are the steps I took to create a c++/Cli  class project.

1.open VS2015 and create new c++/CLI class project,

2. close and open the sln file from MicroStation SDK command prompt

3. add include location to properties.

4. add lib location to properties

5. then all I did was start to add using statements to my header file. I only added #include<Mstn\MdlApi\MdlApi.h>

once I added that I got 2 errors.

cannot open source file "_config-eccp.h"

and #error directive: Data Alignment must be defined in basedefs.h.

im a newbie what it comes to c++...

run time error in vb.net using Point3dInPolygonXY() in microStationV8

$
0
0

Imports MicroStationDGN 

Dim oMStn As New MicroStationDGN.Application

Dim verts() As Point3d = gridEle.AsShapeElement.GetVertices()
Dim verts1() As Point3d = aoiiEle.AsShapeElement.GetVertices()

 Dim centerPt As Point3d = fncGridEle.AsShapeElement.Centroid

 If oMStn.Point3dInPolygonXY(centerPt, verts) = 1 And oMStn.Point3dInPolygonXY(centerPt, verts1) = 1 Then

i am try to run the above code i got below error .

Additional information: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))

[CONNECT U12] IAreaFillPropertiesEdit for a Line Element

$
0
0

I'm creating a Line or Ellipse Element that I need to symbolize. The Ellipse symbolization also includes an AreaFill:

if ( lineElementDesired)
{
    if (SUCCESS != LineHandler::CreateLineElement(eeh, NULL, segment, ACTIVEMODEL->Is3d(), *ACTIVEMODEL))
    {
    ...
    }
}
else
{
    if (SUCCESS != EllipseHandler::CreateEllipseElement(eeh, NULL, dot, ACTIVEMODEL->Is3d(), *ACTIVEMODEL))
    {
    ...
    }
}
// element is cvreated - now symbolize
ElementPropertiesSetterPtr remapper = ElementPropertiesSetter::Create();
remapper->SetLevel(m_levelID);
remapper->SetColor(3);
remapper->SetWeight(0);	// solid fill
remapper->SetLinestyle(0, NULL);
remapper->SetDisplayPriority(2);
remapper->Apply(eeh);

// get the AreaFillPropertiesEdit for the element
IAreaFillPropertiesEditP				editProps = dynamic_cast<IAreaFillPropertiesEditP>(&eeh.GetHandler());
if (editProps)
{
    // Crash here when element is a LINE_ELM - why is editProps not NULL?
}

Shouldn't:

editProps = dynamic_cast<IAreaFillPropertiesEditP>(&eeh.GetHandler());

return a NULL 'editProps'? What AreaFillProperties are there on a LINE_ELM?


Automated quotes - Pipe - Microstation V8i

$
0
0

Good morning everyone! :-)


I wish to obtain pipes quotes automatically, as in the attached example. (Front, top and left view, for example.)

My idea is to get a joined line (chain) for the pipe's axis and, clicking it, obtain the quotes with a macro.

Anyone of us did it in the past? Or something similar? Could you kindly help me, please?

How to use MicroStationDeveloperShell.bat in MicroStation CONNECT Edition 12 SDK?

$
0
0

Hello,

how to use MicroStationDeveloperShell.bat? I already read the readme file and watched the bentley youtube tutorial but i have no clue how to get it working. Maybe i missed something.

  1.  The first thing i tried was running the "MicroStation CONNECT Edition SDK" shortcut from the windows start menu as administrator. After some seconds the cmd windows completed with scanning the drives of the pc. As mentioned in the tutorial video i tried to start visual studio with the devenv command. But no luck only the following error message: The command "devenv" is either misspelled or
    could not be found.

   

2. The second thing i tried was using the MicroStationDeveloperShell.bat directly with the following command: MicroStationDeveloperShell.bat "E:\Program Files\Bentley\MicroStation CONNECT Edition\MicroStation\", "E:\Program Files\Bentley\MicroStationCONNECTSDK\"

The only result i get is a repeating error message: The command "E: \ Program" is either misspelled or
could not be found.

Any suggestions what i'm missing?

Thanks 

Christian

[CONNECT U12] LocalTransformer and DatumConverter types

$
0
0

I'm interested in being able to read/set the Local Transform properties for a GCS. I see two potentially useful classes: LocalTransformer and DatumConverter, but they only seem to be defined, with no exposed methods. Is there currently (or in U13?) anyway to access the LocalTransform information of a GCS?

[CE U12 C# and C++] ElementScanCriteria -> MdlScanCriteriaP() return Value seems to be without reason.

$
0
0

Hello :-)

In V8 it works fine to use MdlScanCriteriaP() and to call mdlScanCriteria_setXAttributeTest(), since there seems no fitting method published in ElementScanCriteria.

In CE the code will lead directly to an exception.

BCOM.ElementScanCriteria scanCri = new BCOM.ElementScanCriteriaClass();
int nTest = scanCri.MdlScanCriteriaP();
Int64 nTest64 = scanCri.MdlScanCriteriaP();

During the debugging I got always something like: 0xfffffffff44c9d50 == -196305584 == scanCri.MdlScanCriteriaP(). A strange thing for a pointer to start with 0xf….

If I go further and try any mdlScanCriteria_...() function I got exceptions like: “Exception thrown at 0x00007FFF4FA90BE0 (DgnPlatform5.dll) in microstation.exe: 0xC0000005: Access violation writing location 0xFFFFFFFFF44C9D5C.”, which is no surprise with such a strange pointer.


So, there are 3 Questions:
1. Is it "just" a bug inside the SDK?
2. Do I need some C#-voodoo bevor I can pass this pointer to native?
3. Is there a way to set XAttribute Test direct in C#, so there is no need to call MdlScanCriteriaP()?


Thanks a Lot.

[CONNECT .NET] ECProperty incompletely documented

$
0
0

The .NET ECProperty appears to lack capability found in the C++ equivalent.  For example, the MicroStationAPI distinguishes between a property name and its display label.  The display label appears to be unsupported in .NET in the documentation for IECProperty.

Likewise, the methods to set/get the EC type name are absent in the documentation.

[CONNECT .NET] Use IElementPropertyEnabler to obtain DGN Element properties

$
0
0

I want to get DGN element properties.  I think that I should be using IElementPropertyEnabler to obtain element properties, using something like GetPropertyValue (className, accessString, element).

Looking at method GetProperties(..., ..., propertyCategory), the third argument is a category mask, documented as A mask indicating the categories to return. However, neither the MstnPlatformNet documentation nor the SDK examples reveal how that mask should be created.  Is there an enum defined for its flags?

Cannot change Working Units Labels using MVBA

$
0
0

I am planning to convert files from International Feet to U.S. Survey feet using a simple VBA macro.  I can change the Working Units and Storage Units with no problem:

CadInputQueue.SendKeyin ("set units ""US Survey Feet"" ""US Survey Inches"" ")
CadInputQueue.SendKeyin ("set storageunit US Survey Foot")

However, I cannot change the MU and SU labels in my MVBA code. 

  • The SET UNITS key-in doesn't allow for setting the label. 
  • Tried using  ActiveModelReference.MasterUnit.Label = <value>, but that does not write the change.

Is there any way I can accomplish this in my code?

Running MicroStation CE  10.10.00.23


Connect VBA, IChangeTrackEvents, linestyles error

$
0
0

Hello!

Excuse my English and probably wrong terminology.

I'm in the process of migrating our MVBA code to Connect edition, but I have a weird problem.

We have IChangeTrackEvents on and track some changes.

But if I set a linestyles element in my code, then it somehow accesses IChangeTrackEvents_ElementChanged in an endless loop.

Example:

Dim oLS As LineStyles

Set oLS = ActiveDesignFile.LineStyles

Then it goes to IChangeTrackEvents_ElementChanged.

Where it goes by action ID 3, 7 and then 3, 17 in a endless loop until crash.

I don't have that problem in Microstation V8i and the code works flawless.

I have a temporary workaround by disabling IChangeTrackEvents while using LineStyles element, but that solution is not good.

Anyone have an idea what could be wrong? I'm running Connect Edition version 10.12.00.40.

[CONNECT U12 C++] Bentley::GeoCoordinates::DgnGCS::ToModel() return code meaning

$
0
0

I've got a tool that uses Bentley::GeoCoordinates::DgnGCS::ToModel() to set a GCS for a model. I need to tweak some settings, but one cannot edit a GCS from CONNECT. I loaded OpenCites U3, and copied the GCS (South Caroline State Plane 3902) into a new User Library and gave the GCS a name more recognizable to my users. Then I exited and returned to CONNECT U12. I can manually attach the GCS from my User Library, but when I try the same programmatically, the ToModel() function return -100001 (FFFE795F). I can successfully attach my original GCS, but not this one. I can find nothing that helps explain what the failure reason is.

Bentley::GeoCoordinates::DgnGCSPtr	pSRS_GCS = Bentley::GeoCoordinates::DgnGCS::CreateGCS(L"SRS Helmert Transfrom", ACTIVEMODEL);
Bentley::DgnGCSP					pModelGCS = Bentley::GeoCoordinates::DgnGCS::FromModel(ACTIVEMODEL, TRUE);
if (pSRS_GCS.IsValid() && pModelGCS == NULL)
{
	UInt32			status = pSRS_GCS->AddRef();
	// ToModel() returns -100001 ???
	StatusInt		iStatus = pSRS_GCS->ToModel(ACTIVEMODEL /*ACTIVEMODEL*/, true/*make primary*/, true/*writeToFile*/, false/*reprojectData*/, true/*reportProblems*/);
	status = pSRS_GCS->Release();
}

Bruce

Need To Change Reference Description by VBA

$
0
0

Any one can help me to make VBA  for change description in Reference

[CE U12 C#] VertexId

$
0
0

Hi all!

In v8i I used  mdkSolid_getVertexLis to get the VertexIds.

I tried the same procedure in MSCE on parametric solids: I get the correct number of vertices, but the ids are void.

Is there a better way to extract the VertexIds from a MSCE parametric solids?

Thanks!

[CONNECT] Analysing DGN Elements using ECSchema

$
0
0

I want to get DGN element properties.  Using the DgnBaseElement schema I can use class MstnClosedBoundary to obtain the area and perimeter from any DGN element type.  That is, MstnClosedBoundary acts as a super-class mixin for any DGN element that is closed and planar.

I don't see the equivalent super-class mixin for linear elements.  If I want to obtain the length of  a line or arc etc. I have to implement a switch statement...

switch (eh.GetElementType ())
{
  case LINE_ELM:
  case LINE_STRING_ELM:
    ecClass = L"MstnLineSegments";
    ecProp  = L"TotalLength";
  break;
  case CMPLX_STRING_ELM:
    ecClass = L"MstnComplex";
    ecProp  = L"TotalLength";
  break;
  case BSPLINE_CURVE_ELM:
    ecClass = L"MstnBSplineCurve";
    ecProp  = L"Length";
  break;
  case ARC_ELM:
    ecClass = L"MstnArc";
    ecProp  = L"Length";
  break;
}

Both the class name and the property name vary, depending on the element type.  Is there a super-class mixin for linear elements?  Is there a super-class mixin for solid elements?  What have I missed?

Viewing all 4331 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>