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

MicroStation CONNECT Edition SDK Update 13

$
0
0

[CONNECT C++]

I'm about to jump into the Update 13 SDK and have a few questions:

  1. The release announcement says "VS 2017 Professional (or better) ":
    1. Anyone using VS 2019?
    2. Can I use VS 2019 Community version?
  2. Will apps compiled using Update 13 SDK run ok on MicroStation CE Update 12 (wondering about backward compatibility)

TIA, Loren.


Connect 13 C#

$
0
0

I am trying to get the line string  information from a curve primitive type of line string, I am using the primitive to get the length of the line string and using other methods without any issues.

Can someone tell me what I am doing wrong?

.

Thank you

Donna

if (cPrim.GetType().Equals(CurvePrimitive.CurvePrimitiveType.LineString))
{ 
   System.Collections.Generic.IList<DPoint3d> ptList = new System.Collections.Generic.List<DPoint3d>();
   if (cPrim.TryGetLineString(ptList))
    {
        // quick check to determine if code is working
        double segmentDistance = ptList.ElementAt(0).Distance(ptList.ElementAt(1));
        System.Windows.Forms.MessageBox.Show("ptList retrieved - " + segmentDistance.ToString());
    }
}

Makefile development: how to find the useable macros?

$
0
0

Hi MicroStation Programmers,

I have a question about developing makefiles for MDL. I am developing under MicroStation V8i SELECTSeries 4.

In the sample MDL project "basic" from the SDK, I found that it is using the marco "genSrc". The corresponding command in the basic.mke file is

                          dirToSearch=$(genSrc)

To understand what this makefile is actually doing, I tried to find out where genSrc is defined. After spending a significant amount of time, I found that the definition of this marco hides deep in the out-of-box MicroStation files. Below is the "include" relationship:

             basic.mke-->mdl.mki-->ConfigurePolicy.mki-->MicroStationPolicy.mki (defines genSrc)

Now it seems to be a problem for me: if I am authoring another MDL like the "basic" sample, how can I know that there is such a genSrc marco I can use. It is almost impossible for me to browse 3 levels down the system .mki files to find the marco that I can use.

Is there any way I can find the list of marcos that I can use, such that I can develop MDL like the "basic" sample?

Thank you!

CE Display Rules C#

$
0
0

Hello, I'm trying to develop an add-in for creating Display Rules in c #. I have a problem creating the condition to pass as a parameter to the constructor of the DisplayRule class.
At this link "">www.bimsdks.com/.../structBentley_1_1DgnPlatform_1_1DisplayRule.html" I found some examples (see Condition format and types) but they are very few.

I implemented the following code that works:

string MyRuleCondition = @"element.IsOfClass (""ShapeElement"",""DgnElementSchema"")";

DisplayRuleSet displayRuleSet = new DisplayRuleSet(RuleStenName, dgnFile);
DisplayRulesManager.WriteDisplayRuleSetToFile(displayRuleSet, dgnFile, true);
DisplayRule displayRuleElement = new DisplayRule(MyRuleCondition, true, dgnFile);

IDisplayRuleAction ruleAction = new ColorOverrideAction(5, dgnFile);
displayRuleElement.AddAction(ruleAction);
displayRuleSet.AddDisplayRule(displayRuleElement);
DisplayRulesManager.WriteDisplayRuleSetToFile(displayRuleSet, dgnFile, true);

keyInCommand.SendKeyin("MDL KEYIN CUSTOMDISPMODE DIALOG DISPLAYSTYLES");
keyInCommand.SendKeyin(@"DISPLAYSTYLE CREATE ""DISPLAY_STYLE_BY_KEYIN""");

keyInCommand.SendKeyin(@"MDL KEYIN VIEWCTRL CHANGE VIEW CUSTOM ""DISPLAY_STYLE_BY_KEYIN"" 1");
keyInCommand.SendKeyin(@"DISPLAYSTYLE SETPARAM DISPLAYRULESET ""DISPLAY_STYLE_BY_KEYIN"" ""Rule""");
ustnApp.CommandState.StartDefaultCommand();


I should implement a RuleCondition that evaluates the value of a property of an ItemType,
does anyone know a way, a tool, or examples (in c #) to create RuleConditions?

Thanks for the help, greetings

[Microstation v8i] [VBA] Parallelepiped containing a groped object

$
0
0

Hi everyone,

can I get the (3D) "parallelepiped" containing a grouped object?

can I get the (2D) rectangle containing a grouped object?

thanks a lot.

Best regards,

Paolo

[Microstation v8i] [VBA] Dimensioning pipes

$
0
0

Hi everyone,

Did you create a VBA macro to automatically dimension a pipe? or an other object?

Have you any idea to suggest me? 

Thanks a lot.

Best regards,

Paolo

[Microstation v8i] [VBA] Creating file for any object

$
0
0

Hi guys,

I wish automatcally create a new file for each grouped object in my main file.

I don't know how many objects a re in the file.

I wish do it with a VBA macro that automatically give the name to the file.

Any suggest? :-)

Thanks a lot.

Paolo 

How to debug Pure MDL?

$
0
0

Hi MicroStation Programmers,

I am supporting a Pure MDL application (compiled with mcomp, etc) in V8i. How can I debug it? What tool can I use?

I tried to find a way to debug in the SDK programmer's guide, but didn't find too much beside the instruction of adding the "DEBUG" keyword in "MDL LOAD" key-in command.

Is there other tool or instruction that can help me?

Thank you!


[Microstation v8i] [VBA] From a 3D mult-objects file to a dimensions

$
0
0

Hi guys,

here my problem: I wish to automatically obtain dimensions for pipes. Please see file named "Aim", with two examples.

The "input" file is a 3D DGN, with several (I don't know how many) grouped objects. Please see file named "Start".

My idea (please correct me, if I am wrong) is to separate each object saving each of them in a own file. Please see file named "1"

I wish user can choice the path where save all files (suggesting last directory used).

About file name, user will be asked about the first name (f.e.: FI-024) and the other file names will be increased by one.

Then, I would like to create two batch (or something similar) files: one for visible edeges, one for dimensions. 

In the first one, I wish, for every file, to launch a macro able to get three visible edges (from top, from front and from left). Please see file named "1 - Visible edges".

In the second one, I wish, for every file, to launch a macro able to get dimensions, as already shown in file named "Aim".

Get visible edges without dimensions would be a GREAT result anyway :-)

 

Let me know, please.

Thanks a lot to everyone.

Best regards,

Paolo 

communities.bentley.com/.../8715.Start.dgncommunities.bentley.com/.../5518.dgn

communities.bentley.com/.../6131.1-_2D00_-Visible-edges.dgn

communities.bentley.com/.../Aim.dgn

[V7 MDL] Access violation occured when Openning DGN file

$
0
0

Hello

Our application loads few hook functions in the main() - extract :

mdlSystem_setFunction (SYSTEM_UNLOAD_PROGRAM, StartActe_unloadProgram);

mdlSystem_setFunction (SYSTEM_EXIT_DESIGN_FILE_STATE, StartActe_exitDesignFileState);

mdlSystem_setFunction (SYSTEM_NEW_DESIGN_FILE, StartActe_newDesignFile);

This has always worked fine (for 20 years), but, for some reason, a trap occurs on some of our computers. 

Exactly the same application is OK on most of our computers.

I haven't find out any difference between the 'OK' computers and the 'KO' computers

Comparing the logs it seems the trap occurs in the function set to open the DGN file : StartActe_newDesignFile()

In this function a check on the 'state' variable is done with

if (SYSTEM_NEWFILE_COMPLETE == state)

I know V7 is no more supported but since our V8i is still not in production...

Can it comes from some windows patch or specific KB ?

OS is Windows 7 or Windows10

Thanks in advance for any clue.

Pascal

CE Display Rules - Condition format and types c#

$
0
0


Hello, I'm trying to develop an add-in for creating Display Rules in c #. I have a problem creating the condition to pass as a parameter to the constructor of the DisplayRule class.
At this link "">www.bimsdks.com/.../structBentley_1_1DgnPlatform_1_1DisplayRule.html" I found some examples (see Condition format and types) but they are very few.

I implemented the following code that works:

string MyRuleCondition = @"element.IsOfClass (""ShapeElement"",""DgnElementSchema"")";

DisplayRuleSet displayRuleSet = new DisplayRuleSet(RuleStenName, dgnFile);
DisplayRulesManager.WriteDisplayRuleSetToFile(displayRuleSet, dgnFile, true);
DisplayRule displayRuleElement = new DisplayRule(MyRuleCondition, true, dgnFile);

IDisplayRuleAction ruleAction = new ColorOverrideAction(5, dgnFile);
displayRuleElement.AddAction(ruleAction);
displayRuleSet.AddDisplayRule(displayRuleElement);
DisplayRulesManager.WriteDisplayRuleSetToFile(displayRuleSet, dgnFile, true);

keyInCommand.SendKeyin("MDL KEYIN CUSTOMDISPMODE DIALOG DISPLAYSTYLES");
keyInCommand.SendKeyin(@"DISPLAYSTYLE CREATE ""DISPLAY_STYLE_BY_KEYIN""");

keyInCommand.SendKeyin(@"MDL KEYIN VIEWCTRL CHANGE VIEW CUSTOM ""DISPLAY_STYLE_BY_KEYIN"" 1");
keyInCommand.SendKeyin(@"DISPLAYSTYLE SETPARAM DISPLAYRULESET ""DISPLAY_STYLE_BY_KEYIN"" ""Rule""");
ustnApp.CommandState.StartDefaultCommand();


I should implement a RuleCondition that evaluates the value of a property of an ItemType,
does anyone know a way, a tool, or examples (in c #) to create RuleConditions?

Thanks for the help, greetings

[Microstation CONNECT EDITION] [c# dotnet] Which API to call to iterate through OLE links?

$
0
0

Hi everyone,

Can anyone suggest to me which class or API to call from c# to iterate through OLE links?

Thanks in advance for your help!!

[VBA] Passing Variables from Module to Modal Handler Class?

$
0
0

Hi all,

Does anyone have any tips on how I can pass variables from a VBA module to a Modal Handler Class that monitors dialog events.

Regards,

Mark

How to rename several items in the "Models" section?

$
0
0

Hello!
I use Bentley Map Enterprise V8i (Select Series 4). I need to rename all the items in the Models menu. There are a lot of names, so I'm looking for a way to rename everything at once. It is necessary at the end of each item to change the letter "p" to "c".
Thanks!

[Microstation Connect Edition] [Update 13] [Version 10.13.01.01] [c++] Getting mesh points from elements

$
0
0

How can I get a complete list of points to draw objects from Microstation Connect like a tours for example?

I have implemented a IElementGraphicsProcessor and when processing a tours I only get 16 points as shown below:

My IElementGraphicsProcessor (cpp):

#include "meshProcessor.h"

MeshProcessor::MeshProcessor(bvector<PolyfaceHeaderPtr>& output, IFacetOptionsP options) : headerOutput(output), facetOptions(options)
{
	currentTransform = Transform::From(0.0, 0.0, 0.0);
}

MeshProcessor::~MeshProcessor()
{
}

bool MeshProcessor::ProcessElement(ElementHandleCR element)
{
	bool success = false;
	headerOutput.clear();
	MeshProcessor dest(headerOutput, facetOptions);
	DgnPlatform::ElementGraphicsOutput::Process(element, dest);
	success = headerOutput.size() > 0;

	if (success) {
		
	}

	return success;
}

BentleyStatus MeshProcessor::_ProcessFacets(PolyfaceQueryCR facets, bool isFilled)
{
	PolyfaceHeaderPtr header = PolyfaceHeader::CreateTriangleGrid(3);
	header->CopyFrom(facets);
	header->Transform(currentTransform);
	headerOutput.push_back(header);

	return SUCCESS;
}

bool MeshProcessor::_ProcessAsBody(bool isCurved) const
{
	return false;
}

bool MeshProcessor::_ProcessAsFacets(bool isPolyface) const
{
	return true;
}

void MeshProcessor::_AnnounceTransform(TransformCP trans)
{
	if (trans)
		currentTransform = *trans;
	else
		currentTransform.InitIdentity();
}

IFacetOptionsP MeshProcessor::_GetFacetOptionsP()
{
	return facetOptions;
}

Header:

#pragma once

#include <PSolid/PSolidCoreAPI.h>

#include <DgnView/DgnElementSetTool.h>
#include <DgnView/LocateSubEntityTool.h>

#include <DgnPlatform/ElementHandle.h>
#include <DgnPlatform/ElementGeometry.h>
#include <DgnPlatform/ElementGraphics.h>
#include <DgnPlatform/MeshHeaderHandler.h>

class MeshProcessor : public DgnPlatform::IElementGraphicsProcessor
{
public:
	MeshProcessor(bvector<PolyfaceHeaderPtr>& output, IFacetOptionsP options);
	~MeshProcessor();

	bool ProcessElement(ElementHandleCR element);
	virtual BentleyStatus _ProcessFacets(PolyfaceQueryCR facets, bool isFilled = false) override;
	virtual bool _ProcessAsFacets(bool isPolyface) const override;
	virtual bool _ProcessAsBody(bool isCurved) const override;
	virtual void _AnnounceTransform(TransformCP trans) override;
	virtual IFacetOptionsP _GetFacetOptionsP() override;

private:

	bvector<PolyfaceHeaderPtr>& headerOutput;
	IFacetOptionsP facetOptions;
	Transform currentTransform;

};

I am trying to retrieve the points used to draw the element however I require more points than this to draw a smooth torus unless I am required to sweep a curve through the few points I have been given. 


[MStn CE U13] Access to elements in Parametric cell

$
0
0

Hi,

this my question is one from "best practices questions" (and also about feature design), not specifically targeted to C++ or NET API (I did tests using C#):

Question: Is it possible to access elements inside parametric cell instance?

Why: In some scenarios, it would be nice to have a parametric cell with attached custom data (XAttributes or EC data) inside and to access the data after the cell is placed.

Now (see this my post in MicroStation forum) it seems that to attach EC data to elements or to cell (model) is not supported and when the instance is created, the cell definition content is "black boxed" and not available.

What I tried: I think, after reading C++ API doc and implementing some tests in C#, I understand how parametric cells persistence is implemented:

  • When the parametric cell is placed, the instance is created in dictionary model (but ParametricCellDefinitionElement (ParametricCellDefHandler) returns default model as its container?), so it's not "visible".
  • Similarly to shared cells, the parametric cell instance is represented by ParametricCellElement (ParametricCellHandler).
  • It's possible, using classes like ParametricCellDefinitionElement, PrametricCellinfo etc., to obtain the cell details like variables, location, transformation....
  • Using ElementGraphicsProcess, it's also possible to receive the cell geometry.

But there is no way to obtain source definition (elements, constraints...) from instance or hidden cell definition, and to check whether custom data has been attached to the cell. Even EC representation does not provide any details.

Is it "by design", so it's not possible to go inside the cell and custom data can be attached only after the cell is placed (so they will be attached to the instance element)?

With regards,

  Jan

It's possible That python supported with Microstation

$
0
0

Hi,

I Have one doubt Is it possible  to python connected with microstation ?

Please answer to the my query 

How to modify view's level display by MDL(C++) in MSCE?

$
0
0

Hi there,

Now I can modify globle level display like this:

By following C++ code:

DgnFileP activeDgnFile = ISessionMgr::GetActiveDgnFile();
if (NULL == activeDgnFile) return false;

FileLevelCacheR levelCache = activeDgnFile->GetLevelCacheR();

for (EditLevelHandle level(levelCache.begin()); level != levelCache.end(); ++level)
{
    level.SetDisplay(false); 
}
levelCache.Write();

But how to modify the current view's level display using C++ Code? like this:

Thanks . 

Santa

python code is used for microstation

$
0
0

HI ,

How can I use python code in microstation for creating tools.

[CE] Run a Saved Batch Conversion Job from the System Command Line - Does not work

$
0
0
Hello,
I created a batch convert job file,which merges between a file and its references.
Using it from the Micorstation environment it works correctly, if instead I try to use a Run a Saved Batch Conversion Job from the System Command Line
"msbatch batchconvert C:\Users\montella\Desktop\BCNV\CONVERT_TO_3D_MERGE_TEMPLATE_CE.BCNV"
it doesn't work, nothing happens.

If I try to do the same thing in V8i it works ...

Can someone help me ?


Thanks for help
Viewing all 7260 articles
Browse latest View live


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