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

RE: tooltips in Microstation

$
0
0
Hi,

can you specify what MicroStation version and what language do you use?

With regards,

Jan

RE: tooltips in Microstation

$
0
0
Using Microstation 8,11,09.829 and Visual Studio 2015 with C#

RE: tooltips in Microstation

$
0
0

[quote user="willmartinpe"]To hover over an element and display some customized  'tooltip'[/quote]

Do you want custom tooltips when your app. is active, or more generally.

For example, if your app. is to do with water pipes, do you want a tooltip that describes a line element as "Water pipe 200mm" under the right circumstances?

RE: tooltips in Microstation

$
0
0

Hi,

in my opinion the only way how to customize element information hint / tooltip is to use MDL API which requires to use Visual Studio 2005 to compile native C/C++ code.

I recommend to search BE Communities for LOCATE_PROVIDE_PATH_DESCRIPTION, because it's callback value used for LocateFunc_providePathDescription. Also see MicroStation V8 MDL Function reference for furher details.

With regards,

  Jan

RE: tooltips in Microstation

$
0
0
yes I would like to hover over and see something like Water Pipe 6"PVC

RE: [V8i C++] How to rename reference files via MDL/Api

$
0
0

That's what I'm trying to do. My "environment variable" is defined in the .UCF file, and when I pass the string to mdlRefFile_reattach() as "REFHOME:fileName", I get a SUCCESS return code, but I don't get the display of the filename as "REFHOME:fileName", I just get the same thing I started with: "fileName". I can manually insert it using the reference file's "Settings" - I just can't seem to do it via native code...

 

Bruce

RE: tooltips in Microstation

$
0
0

If you know how to "extract" the information you want from the element you're hovering over, it can be done using the method Jan/Jon mentioned.

RE: tooltips in Microstation

$
0
0
I am using C#
I looked at the LOCATE_PROVIDE_PATH_DESCRIPTION in the API reference and do not understand in the least how to set that up.
Also, what is the command state in which this takes place, i.e., a locate command or primitive command?
I would like to see a fleshed out example.

RE: tooltips in Microstation

$
0
0

If you want it "active" all the time, you can set the function up in some code you load a startup (DGNAPP or INITAPP). You use mdlLocate_setFunction() to start it, and supply a function that gets called as the locate logic finds elements. Your task is to determine the information you want to display and essentially "append" it to the MicroStation information that is displayed. Here is an old example that displays an element's line style name.

 

Public void myLocateInfo
(
	DisplayPathP    path,
	MSWChar*     	description,
	MSWChar*	refStr
)
{
	ElementRef  eRef;
	MSElement   el;
	char		styleName[64];
	MSWChar		wStyleName[64];
	int			eSize;

	eRef = mdlDisplayPath_getCursorElem (path);
	eSize = elementRef_getElement (eRef,&el,sizeof el);
	sprintf_s(styleName,sizeof(styleName),"\n");
	mdlElement_getEffectiveLineStyle(styleName+1, NULL, &el, ACTIVEMODEL, NULL, 1);
	mdlCnv_convertMultibyteToUnicode(styleName, -1, wStyleName, 64);
	mdlWideChar_strcat ((MSWideChar*)description, (MSWideChar*)wStyleName);

}

It's C++, but you should get the idea.....

 

Bruce

RE: tooltips in Microstation

$
0
0

Hi,

[quote user="willmartinpe"]I am using C#[/quote]

I guess it was clear: You have to use MDL / C API, there is no equivalent in C# (which in fact is not pure managed NET API, but only Interop in V8i).

[quote user="willmartinpe"]I looked at the LOCATE_PROVIDE_PATH_DESCRIPTION in the API reference and do not understand in the least how to set that up.[/quote]

This is a standard way how hook functions / events were (in fact still are) implemented in C language: You create callback function with defined pattern (parameters and return value) and use the name of this function (variable) to set up it as mdlLocate_setFunction together with LOCATE_PROVIDE_PATH_DESCRIPTION parameter. You can find examples in MDL examples, search for mdlLocate_setFunction.

[quote user="willmartinpe"]Also, what is the command state in which this takes place, i.e., a locate command or primitive command?[/quote]

See Bruce's code snippet.

With regards,

  Jan

RE: tooltips in Microstation

$
0
0
Public void myLocateInfo
(
DisplayPathP path,
MSWChar* description,
MSWChar* refStr
)

What is DisplayPathP and where does it come from?
What kind of description? Anything I make up?
refSTR what is it?

RE: tooltips in Microstation

$
0
0

[quote user="willmartinpe"]What is DisplayPathP and where does it come from?...[/quote]

I guess it tells enough...

With regards,

  Jan

RE: tooltips in Microstation

$
0
0
Forgive my ignorance but before this I have never heard of a DisplayPath. I do not know where you get it or how it relates to the cursor. A brief description other than in terms of itself would help me tremendously.

RE: tooltips in Microstation

$
0
0
Hi,

if you have MicroStation V8 MDL Function Reference help file (and I guess you have it) as you mentioned API reference earlier, I recommend to start with Working With Elements > Display Paths chapter, where this concept is briefly explained. Better than to copy-paste bunch of information ;-)

With regards,

Jan

RE: tooltips in Microstation

$
0
0
A DisplayPath represents the item that is currently being "located". Exactly "what" it contains is never defined/documented such that you can understand it. The key is that you can use it to get to the model element that is currently being "located". You need to have some relationship between the element being located and the data you want to display...

RE: tooltips in Microstation

$
0
0
Important for you, if you receive DisplayPath in call back funciton, can be mdlDisplayPath_getElem() function that allows to extract ElementRef (element identification) from DisplayPath.

But in my opinion in the first step it may be better to focus to change tooltip to anything to test the code is working and ignore DisplayPath information temporarily.

Regards,

Jan

RE: tooltips in Microstation

$
0
0

[quote user="Bruce Reeves SRNS"]Exactly "what" it contains is never defined/documented such that you can understand it. [/quote]

Good and important note! :-)

Just for reference, it's defined in mstypes.h as

typedef struct DisplayPath const* DisplayPathP;

where DisplayPath struct is not defined anywhere (at least I was not able to find it), so it's "opaque pointer" that is used as value passed to and from mdlDisplayPath_ and other functions.

With regards,

  Jan

tooltips in Microstation

$
0
0

Is there anyway to custom the 'tooltips' such as are displayed with element selection.

To hover over an element and display some customized  'tooltip'.

RE: Helix method generates inconsistent B-Splines

$
0
0

I wrote a macro based in excel that creates spiral stairways for storage tanks & ran into the exact problem you are describing. The resulting helix was beyond our shops fabricating tolerances. They would never have fit together in the field. The only solution is to drive the microstation helix tool. It works fine, but is slower than the vba helix code. Be sure to send explicit data to each of the tools settings, else it could use an existing data already present in the dialog box. Also, I could not get it to place the helix at the start azimuth I wanted, so I simply rotated it with some extra code.
I also found it was easier to copy the original helix the correct depth of the stringer & then skin a surface between them to create the surface than to extrude a shape, as I had issues with the profile twisting as it progressed along the helix. Dont forget to offset some helix copies for your handrails as well. You can get it to work, it will just take more coding than it should have.

Do as Jon suggests and record a macro while changing all the settings. It does record all the necessary key strokes you will need.

RE: Project points to the surface?

$
0
0

Hi Karthik,

in my opinion some analytic geometry facts should be clarified: You asked "Project points to the surface", but as you wrote, you have non-planar shape in your design file. They are two completely different things, something like to say line and circle are the same. And you should be aware that regardless MicroStation allows to create non planar shapes, it's usually treated as incorrect geometry that cannot be used for geometry computation.

With quite big simplification:

  • A surface is geometry where every point of the surface is defined. There are plenty of types of surface like B-spline etc. and usually local surface coordinates are defined and X,Y on surface can be converted into X,Y,Z in space.
  • Shape is MicroStation term, I guess more often (planar) polygon term is used. If shape is planar, it's possible to calculate any point belonging to shape internal area, because it's in fact simple plane. But if you  have non planar shape, there is no math formula available defining what is inside the shape. MicroStation is able to work with non planar shapes, but it's MicroStation specific and can be changed anytime (in fact the process how non planar shapre are processed is different in V8i and CONNECT Edition).

The summary is that even if you will find some method (I guess not in VBA but maybe in MDL) how to project point to non planar shape, it's not defined anywhere what does it mean and how it works.

I don't know concrete solution (did you try to search this forum?), but I guess it's about to convert the shape into some more correct geometry (SmartSurface, mesh, maybe also B-spline surface, but I am not quite if it's good idea) and in the second step to find a method calculating the intersection between ray and the element. I think for example there is such function available for mesh in MDL API.

Alternative solution can be - but only if the unplanarity is very little and is caused by creation error, not because the shape is e.g. terrain boundary - to calculate an average plane from the shape vertices, so the solution will be converted into intersection between ray and plane, which is easy and can be done in VBA.

With regards,

 Jan

Viewing all 7260 articles
Browse latest View live


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