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

[CONNECT C++] IBrowserHelpClient

$
0
0

I found the BrowserHelpClient while browsing MicroStationAPI help.  Can I use that class to open my own URL?


[CONNECT C++] Possible to build std::vector of CaretCP or CaretPtr ?

$
0
0

I'm using FindText to locate expressions that represent a fraction. Once found, I'd like to save the match Caret locations in a std::vector<> for later use in editing the string, but I can't get the vector to "work".

CaretCR			matchStart = textMatch->GetMatchStart();

std::vector<CaretCR>     startMatchCaret;

// or

std::vector<CaretPtr>     startMatchCaret;

// or

std::vector<CaretCP>     startMatchCaret;

startMatchCaret.push_back(matchStart);

 

 

Bruce

[CONNECT C++] Inserting verses Appending text into a Text Block

$
0
0

I've got a TextBlock that I use FindText() to locate "fractions" using regular expressions. Once one is found, I save the matchStart and matchEnd Carets (in a std::vector). Once the FindText() loop is complete, I step backwards thru the vector and process the matches from the end to the beginning (so I don't corrupt the Caret locations). When I find certain fractions, I want to "replace" them with a symbol, like "copyright" (\xA9).

 

The original text uses a resource font. When I do the replace, I'm using a different font. I called SetFont() on the textBlock RunProperties so that "edits" will utilize the new font. I can InsertText() and ReplaceText() without issue when I use a "normal" character value, but when I try to use \xA9 or \x00A9, CONNECT crashes. I am able, via the editor, to manually insert the \xA9 character from the replacement font without issue, so It is possible to do - I just can't get it to work programatically. If I use AppendText(), the new symbol appends just fine (with the new font), without issue (except it is in the wrong location).

 

Are there special requirements for inserting "symbols" into a TextBlock? The crash dump appears to be complaining about calls to ToString(), which I use to get a "plain text" representation of the initial resource font based text string. I do that so I can perform the FindText() to locate the fractions.

 

Bruce

Find Intersection

$
0
0

Hi Every body.

I have a problem with intersection function .unfortunatly the function do its job too late.what can i do with that? i have two array of line elements and wanna find intersections of them. I use one array in a FOR cirrcel two find intersection of it line elements with one by one with the lines in other array. I need a solution to do it fast in VBA.

Can any body helpme please

[CONNECT C#] Problem Building Example with Viz Studio

$
0
0

When I build a CONNECT C# example (e.g. ManagedToolsExample) from the SDK prompt, all is well.  If I run openSln.bat to open Viz Studio from the same SDK shell then I see several errors similar to this...

...\SDK\examples\Elements\ManagedToolsExample\PlaceGroupedHoleTool.cs(72,25,72,38):
error CS0115:'PlaceGroupedHoleTool.OnPostInstall()': no suitable method found to override

I don't understand why that message occurs in Viz Studio, since it clearly inherits from DgnPrimitiveTool and builds successfully from the SDK prompt...

class PlaceGroupedHoleTool : DgnPrimitiveTool {}

Neither DgnPlatformNet nor MstnPlatformNet reveal any information about DgnPrimitiveTool!

vs2013 mdl 生成失败

$
0
0

命令框中用 bmake -a 能够通过,但是用vs 自动生成失败提示如图

然后尝试采用国外部工具的方式 出现以下错误

[V8i - VBA ] Text without textstyle shows active text style property

$
0
0

Hello,

 When using this code :

    If oElem.IsTextElement Then
        textStyleName = oElem.AsTextElement.TextStyle.name
    End If

If the text element has no text style (textstyle "none"), The textstyle.name property of the element  is set to the active text style name.

How can i know if the text has textstyle "None" ?

Many thanks and regards

[CONNECT C#] MyApp Example: KeyinTree.rtf

$
0
0

SDK Example MyApp includes a file KeyinTree.rtf, which is shown in the Viz Studio project.

KeyinTree.rtf looks like an XML schema definition.  Is it there intentionally and, if so, what does it do?


[CONNECT C#] C# compiler warning CS1762

$
0
0

My KeyCommands.cs model uses these two references...

using Bentley.MstnPlatformNET.InteropServices;
using Bentley.Interop.MicroStationDGN;

Both are necessary because of this..

Application app = Utilities.ComApp;
app.CadInputQueue.SendCommand("mdl unload AppName", true);

The C# compiler is unhappy.  It tells me this...

1>CSC : warning CS1762: A reference was created to embedded interop assembly 'Bentley.Interop.MicroStationDGN,
Version=8.0.0.0, Culture=neutral, PublicKeyToken=4bf6c96a266e58d4' because of an indirect reference to that assembly
created by assembly 'Bentley.MicroStation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=4bf6c96a266e58d4'.
Consider changing the 'Embed Interop Types' property on either assembly.

It's a warning, so I can ignore it.  But ignoring warnings, experience tells me, can lead to trouble.  As far as I can see there's nought I can do about it.  What's Bentley's view on Bentley.MicroStation and Bentley.Interop.MicroStationDGN and the Embed Interop Types property in those assemblies?

[CONNECT C#] How do I get my Task ID?

$
0
0

I want to get the name of my .NET task ID using C#.  It's a static method...

AddIn.GetMdlTaskID (addInAttribute);

But what is the correct addInAttribute

I'm looking for the .NET equivalent of the MicroStationAPI mdlSystem_getCurrTaskID ().

[CONNECT C++] Possible Issue with CONNECT U5 SDK

$
0
0

I'm including the file:

#include <DgnPlatform\DetailingSymbol\DetailingSymbolHandlers.h>

 

and when the compiler runs, I see errors relating to "ViewElementHandlerSubTypes.h". Can anyone confirm this ?

 

ViewElementHandlerSubTypes.h(47): error C3646: 'GetCalloutType': unknown override specifier

ViewElementHandlerSubTypes.h(47): error C2275: 'Bentley::ElementHandleCR': illegal use of this type as an expression

...

 

Thanks,

Bruce

[CONNECT C++] Question about FontMaps

$
0
0

I'm dumping out a list of Font Names and Numbers in the DgnFile:

extern	"C"	DLLEXPORT void ListAllFonts(WCharCP unparsed)
{
	DgnFontNumMapP		fontNumMap = DgnFontManager::GetDgnFontMapP(ACTIVEMODEL);	// All fonts in DgnModel

	DgnFontListPtr		pFontList = fontNumMap->CreateUsedFontList();
	//DgnFontListPtr		pFontList = fontNumMap->CreateUsedFontList(DgnFontFilter::Resource);

	wprintf(L"Number of Fonts in DgnFile: %d\n", pFontList->GetCount() );

	for ( UInt i=0; i<pFontList->GetCount(); i++ )
	{
		DgnFontP		pFont = pFontList->GetEntryP(i);
		UInt32			fontNum;
		fontNumMap->GetFontNumber(fontNum, *pFont, false);
		wprintf(L"[%d] FontNum:%d, %s\n",i, fontNum, pFont->GetName().c_str() );
	}
}

 

However, when I run the code, all I get are TrueType fonts:


As you can see, my model (DgnFile) uses a Resource font (SRS Standard):


So if I re-run the code and specify "DgnFontFilter::Resource", then NO fonts are returned:


So what am I doing wrong?

 

Bruce

Setting SWA size with MVBA

$
0
0

I am looking for MVBA objects/properties/methods that I can use to change the size of the Solids Working Area.  I can change everything pertaining to working units with an MVBA macro except for the SWA  Where do I look?  I am running MicroStation 08.11.09.459.

[VBA - V8i] How to access the text portion of a dimension?

$
0
0

I'm tweaking an old macro of mine that toggles text background on and off for selected elements. It works for text and text nodes; I want it to work for dimensions (and notes) and text in cells.
The Cells don't seem too bad - enumerate and run through the contents to modify any that are text/text nodes.

Dimensions appear to be another animal. I cannot tease out how to identify and access the text portion of the dimension. I see how to tell if there IS text, I can see how to read those text strings, but I don't know how/if I can directly modify those pieces of text.

Does anyone have any suggestions or success at this type of thing? Thank you!

[CONNECT .NET] MstnPlatformNet Forms Classes

$
0
0

I want to find how to make my C# AddIn project's WinForm a child of MicroStation's main window.  Is that possible?

While browsing MstnPlatformNet help I came across the Bentley.MstnPlatformNET.WinForms Namespace.  It contains a number of useful-looking classes with little indication of their purpose.  For example, are the following relevant to my first question?

  • MicroStationWin32
  • Adapter

There are some classes that look like they might be interesting, but I don't see how to use them.  For example, the ItemTypeSelectionForm Class, which is documented with an unpublished source file...

[DialogInformationAttribute(EnglishTitle = "Item Type Selection", Status = DialogInformationStatus.SystemDialog,
	SourceFile = "$Source: mstn/mscore/clr/MicroStation/WinForms/Controls/ItemTypeSelectionForm.cs $")]
public class ItemTypeSelectionForm : Adapter

Resize a rotated rectangle with click and drag

$
0
0

I need to develop a program in mdl that will allow a user to resize a rectangle.  The user can select any corner point or side and drag to a new position.  This would be similar to resizing a window or cropping a picture and needs to be interactive.  There is no problem when the rectangle is not rotated, but of course, the user would like this to work with a rotated rectangle.

I am able to scale the rectangle using mdlElmdscr_transformAllowModification as has been documented in several posts in this forum.  However, I have not been able to let the user change the width and the height and update the aspect ratio while maintaining right angles.  If I vary the scale in the X or Y direction, the rectangle is distorted.

There was one post about rotating the element to a normal view, resizing and rotating it back, but I'm not quite sure how to do this while a user is dragging points or lines with the cursor.  I was hoping there would be a suggesting on how to do this while maintaining the current rotation.

I'm building this using compiler Version 08.05.02.27 and running in Navigator v 08.11.09.713.  

 Sample code:

mdlTMatrix_getIdentity(&tMatrix);
mdlTMatrix_scale(&tMatrix,NULL,xscale,yscale,1);
mdlTMatrix_setOrigin(&tMatrix,&originPt);
mdlElmdscr_transformAllowModification(&edP,&tMatrix,gRefModelP,gRefModelP,0);  

 

[CONNECT C++] Using a RunRange

$
0
0

Using a RunRange is a very easy way to navigate the parts of a TextBlock. However, There seems to be very little one can actually use it for (ToString() and GetProperties() functions). I have a desired to be able to utilize FindText() on ONLY certain sections (i.e. runs) of a TextBlock. It *seems* it is not possible to obtain the start and ending caret of the RunCR when using a "for each..." construct on a RunRange. IF only it were possible...

 

RunRange				runRange(*textBlock);
for each(RunCR  thisRun in runRange)
{
    // wish I could get start and end carets for "thisRun"
}

What I've tried is to create a TextBlock that represents the text of the "thisRun". However, when the temporary textBlock is made, all character encodings are lost when the TextBlock is created:

 

TextBlockPtr			tempTextBlock = textEdit->GetTextPart(eeh, *textPartId);
tempTextBlock->Remove(*textBlock->CreateStartCaret(), *textBlock->CreateEndCaret());
tempTextBlock->AppendText(thisRun.ToString().c_str());  // We lose all encodings....

 

If there is a way to get Carets for the current RunCR please inform me.

Bruce

[connect update 5] SDK Update 5 info

$
0
0

Hi,

Does anybody have list/link  of fixed issues in SDK for Connect update 5 (10050040)?

Thanks

Nenad

[Connect SDK update 5] Errors when including PointCloudApi.h

$
0
0

Hi,

My system is windows 7, VS 2013, VS 2015, NO clr support

I get same 11 errors, VS2013 and VS 2015 when including PointCloudApi.h

Same errors has occurred in update 1,2,3 and 4

Error list:

Error 9 error C2039: 'OrientedBoxCR' : is not a member of 'Bentley::DgnPlatform'
Error 12 error C2039: 'OrientedBoxCR' : is not a member of 'Bentley::DgnPlatform'
Error 14 error C2061: syntax error : identifier 'IPointCloudChannelVectorCR'
Error 10 error C2061: syntax error : identifier 'OrientedBoxCR'
Error 13 error C2061: syntax error : identifier 'OrientedBoxCR'
Error 11 error C2061: syntax error : identifier 'PointCloudChannelId'
Error 6 error C2061: syntax error : identifier 'PointCloudPropertiesCR'
Error 8 error C2065: 'Xyz' : undeclared identifier
Error 15 error C2535: 'Bentley::IPointCloudQueryBuffersPtr Bentley::PointCloud::IPointCloudDataQuery::CreateBuffers(UInt32,UInt32)' : member function already defined or declared
Error 7 error C2653: 'PointCloudChannelId' : is not a class or namespace name
18 IntelliSense: cannot open source file "_config-eccp.h"

Any suggestions?

thanks

Nenad

what is the best way to delete everything in a file except visible elements in view 1.

$
0
0

I am looking to remove everything in a dgn file except what is visible in view 1. It looks like mdlScanCriteria_setViewTest will scan what I want to keep.And then I suppose I could create a new file with the mdlWorkDgn functions. But in years past that has not been the most reliable technique for me if the drawing has had any corruption in it.

What I would prefer is something that would scan what I want to delete. Or is there a better way to accomplish this?

BTW, I am on Microstation SS3.

Viewing all 4331 articles
Browse latest View live


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