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

RE: V8i C# Addin - raster attachments

$
0
0

Hi Mike,

[quote user="Mike Robertson"]I'm running some reports on both drawing & raster attachments and it just looks a little nicer & runs a little quicker when I don't have to startup graphics.[/quote]

Yes, it's pretty often about the balance between a speed and have everything initialized properly ;-)

In fact the opening a file for program is often enough for the most of  needs (especially if native C/C++ is used instead of limited Interop API), raster attachments are one from exceptions.

In my opinion there is a way how to hide the process from a user (use external process and start MicroStation through interop with visibility switched off), but I agree to show something provides good information that something is happening.

With regards,

  Jan


RE: [Connect update 4 mdl] Does mdlKISolid still exists in Connect?

$
0
0

[quote user="Nenad Poljcic"]Never mind, I have found what I was looking for[/quote]

Can you share your findings and used solution? It will help others...

Regards,

  Jan

RE: [Connect update 4 mdl] Does mdlKISolid still exists in Connect?

$
0
0

Hei Jan,

I use windows 7, Visual Studio 2013, Framework 4.5.2

Project references:

You vill find ElementId,MSElementDescr....   in Bentley::DgnPlatform namespace

If You remove letters "KI" from v8i mdl solid function name, you vill get most of new CE mdl solid functions.

Example mdlKISolid_beginCurrTrans is know mdlSolid_beginCurrTrans.

Most of parameters has to be redefined ,  KIENTITY_LIST,KIBODY.. are replaced with TAG_ENTITY_LIST, BODY_TAG......

I use Visual Studio Object Browser or Intelisense to take a look at function parameters.

 

Hope this helps

regards

Nenad

 

 

RE: [CONNECT C++] Header File Error/Omission

$
0
0

Hi Bruce,

please try using DgnPlatform\DgnPlatformApi.h which includes SymbologyReporter.h

and should ensure no dependency issues are encountered.

Hope this helps?

Best regards,
Artur

RE: [CONNECT C++] Header File Error/Omission

[CONNECT C++] Header File Error/Omission

$
0
0

I'm trying to use SymbologyReporter to look at element properties. When I include SymbologyReporter.h, the compiler complains about these two entries in the header file:

 

typedef bvector<Bentley::WString>           T_StdWStringVector;

typedef bvector<ElementFillColorData>       T_StdFillColorVector;

 

The first was resolved by using:

typedef bvector<WString>           T_StdWStringVector;

 

and the second was resolved by adding another include file to the top of the header file:

#include    <DgnPlatform/TemplateSymbologyRemapper.h>

 

Bruce

RE: [CONNECT C++] Line Style Name question. How does CONNECT resolve Line Style Names without a .rsc/.dgnlib?

$
0
0
OK - it looks like mdlLineStyle_nameFromNumber() or possibly LineStyleManager::GetNameFromNumber() will do the trick

[CONNECT C++] Line Style Name question. How does CONNECT resolve Line Style Names without a .rsc/.dgnlib?

$
0
0

I'm developing a CONNECT "DGNAPPS" tool for importing MicroStation/J files. I've got some lines with "custom" linestyles (defined in our V7 .rsc file). When I open (and let MicroStation convert the file ) in CONNECT, if I look at "Properties", the dialog shows the V7 LineStyleName, along with <Not Found>. That makes sense because I have not yet migrated the .rsc file into the CONNECT environment (not planning on doing that).

 

I'm trying in my code to extract the LineStyleName using MdlElement_getLineStyle(), and the function returns SUCCESS, but the name is NULL (I do seem to get the parameters). I'm wondering how/where CONNECT is getting the V7 style name without the resource file, and can I do the same? We will not continue to use those V7 line style definitions - we're developing new ones. However, I need the V7 "name" so I know how to upgrade the element to the "new" line style.

 

Bruce

 


RE: Use Excel to run Macro in Microstation PowerDraft

$
0
0
Hi Jan,

I wasn't aware about the code insert tool, I edited my post with the code tool.

I don't want to use the startup_file parameter since I don't want to execute a specific macro each time the .DGN is open, I want to be able to call specific macros in that .DGN when I need to.

I am aware that PowerDraft v7 is very old, but I'm still wondering if there's a way to do what I'm trying to do: use an Excel macro to open some DGN files and run some macros in that DGN, close the DGN and return to the Excel macro.

Thank you.

RE: Use Excel to run Macro in Microstation PowerDraft

$
0
0

Hi Julien,

[quote user="Julien Bissonnette Lapierre"] but I'm still wondering if there's a way to do what I'm trying to do: use an Excel macro to open some DGN files and run some macros in that DGN, close the DGN and return to the Excel macro.[/quote]

In my opinion it's not possible without some development effort on both sides (probably quite complex on PowerDraft side), because PowerDraft 7 does not offer any technology for controling it from outside.

But maybe somebody else will recall some trick.

With regards,

  Jan

RE: [CONNECT C++] IViewManager::LoadSpriteFromRsrc replacement attempt

$
0
0
A replacement for IViewManager::LoadSpriteFromRsrc is scheduled for update 6.

RE: [CONNECT C++] How to get a LevelId from a .dgnlib

[CONNECT C++] How to get a LevelId from a .dgnlib

$
0
0

In V8i we used to do this to get a LevelID:

LevelID		newLevelID;
if ( ERROR == mdlLevel_getIdFromCode(&newLevelID, ACTIVEMODEL, 99999))
	mdlLevel_getIdFromCode(&newLevelID, LEVEL_LIBRARY_MODELREF, 99999);

but in CONNECT, we can use the LevelCache:

LevelCache	&levelCache = eeh.GetDgnFileP()->GetLevelCacheR();	// ONLY levels IN the current file
for (LevelHandle level (levelCache.begin()); level != levelCache.end(); ++level)
{
	if (level.GetLevelCode() == 99999 )
	{
        }
}

but this seems to only search for levels in the specified DgnFile. How do we emulate the action of the V8i "LEVEL_LIBRARY_MODELREF"

 

 

Bruce

RE: [Connect C++] Attach reference file including a raster attachment

$
0
0

(Please visit the site to view this file)

[Connect C++] Attach reference file including a raster attachment

$
0
0

I want to attach a reference file that includes a raster attachment. I use these few lines of code:

DgnAttachmentP		newAttachment;
DgnDocumentMonikerPtr moniker = DgnDocumentMoniker::CreatePortableMoniker(L"RefFile.dgn", NULL, NULL, NULL, NULL, DgnPlatform::RelativePathPreference::CreateIfPossible);
ISessionMgr::GetActiveDgnModelRefP()->CreateDgnAttachment(newAttachment, *moniker, nullptr, true);
newAttachment->SetNestDepth(99);
newAttachment->WriteToModel();

It seems to work fine but the raster attachment in the reference file is not displayed and it is not listed in the Raster Manager dialogbox. However, if I keyin the command "newfile" the raster attachment will be displayed and it is lislted in the Raster Manager dialogbox.

To illustrate my problem I've created a small test case: I've attached a ZIP file with 4 files: MasterFile.dgn, RefFile.dgn, the rasterfile "DDOland 2014.jpeg" and the corresponding .jgw file. If you open MasterFile.dgn and execute the lines listed above you will see that only the outline of the raster attachment is displayed.

If you attach the reference file manually it works just fine. What am I missing in my code ?

Regards, Evan


RE: [CONNECT C++] How to get a LevelId from a .dgnlib

$
0
0

Yes Bruce, you are very, very close! :)

LevelCache::GetLevel can take an optional 2nd boolean parameter ("True") allowing you to query for a level in the available level libraries.

See also: How do I migrate LEVEL_LIBRARY_MODELREF

HTH,
Bob

RE: Microstation v8i addIn c# How to "free" dll after unloading

$
0
0
Has to do with what domain the app is loaded into. Try the below syntax. unique is just some string, you can use any string.

MDL LOAD csAddins3,,unique
clr unLOAD domain unique

Microstation v8i addIn c# How to "free" dll after unloading

$
0
0

Hi,

I am using vs 2010 to create c# addin dll files.My debug folder is defined in Microstation as AddIns search path. After building project I load dll in Microstation, run and unload using mdl dialog.After dll is unloaded in Microstation, can not build same dll in same location

because unloaded dll is locked by Microstation. How do I pass this problem?

 

Thanks ,

Martin

 

 

RE: [Connect update 4 C++] Problem with including PointCloudApi.h

$
0
0

Hi Nenad,

without knowing details, I guess something is wrong with header files include. To understand your project better, a few questions:

  • How do you compile your project? Using preferred bmake or using Visual Studio?
  • Why do you use "PointCloud/PointCloudApi.h"? Accordingly to C and C++ best practices, system headers should be included using < > (so <PointCloud/PointCloudApi.h>) where search path is defined as a part of building process. Using " " is for the project specific (local) header files.
  • Is there any warning or error reported related to e.g. not found some other nested header file?

With regards,

  Jan

RE: [Connect update 4 C++] Problem with including PointCloudApi.h

$
0
0

Hi Jan,

I compile using Visual Studio.

Changed it to #include <PointCloud\PointCloudApi.h>

"Is there any warning or error reported related to e.g. not found some other nested header file?"

There is no warning.

I used Object Browser and searched for OrientedBox, it should be declared in DgnPlatform but I only founded it in DgnPlatformNET.

I am not sure, but it looks like something is wrong or missing in header files.

regards

Nenad

Viewing all 7260 articles
Browse latest View live


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