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

[v8i SS3 VBA] Attach Cell Library Folder

$
0
0

Hi everyone,

I want to attach more than one cell libraries.

1, I've tried these code:

DetachCellLibrary
AttachCellLibrary lib_path_1
AttachCellLibrary lib_path_2

Library 1 will automatically be detached and then lib 2 is attached.

2. I could do it manually by attaching folder.

How is the best way to do it?

Any idea will be appreciated!

Regards,

Cindy


[CONNECT U7] Dependency vs AssociationPoint

$
0
0

I've got a tool that automatically "splits" a line or lineString and places a cell in the opening between the two resulting lines/lineStrings. I've also got a tool that enables the user to delete the cell and have the two line/lineStrings "reconnect" itself into a single line/lineString. I'd like to establish a "relationship" between the cell and the line/lineStrings. I can think of two approaches: Dependencies or AsscoiationPoints. I've done some work with dependencies before, but I am wondering if a similar thing might be possible (i.e. easier) using AssociationPoints. What I'd like to do is once an "inserted" cell is deleted, to be able to retrieve the two ElementIDs of the line/lineStrings that were "split" when the cell was inserted. I know the ElementIDs of the resultant "split" lines, and am looking for some way to "store" that information with the cell so it's easier to retrieve than the way I'm currently doing.

Bruce

Error compiling MT resource file with CONNECT SDK Type Resource File Generator

$
0
0

Hello guys,

I recently installed the latest CONNECT SDK platform and also Microsoft Visual Studio 2015.

I am in the process of migrating several of our MDL applications. I tested and built some of the SDK sample applications. All runs as anticipated.

At this point I am attempting to build one of our own MDL applications. The bmake command runs as expected but fails when compiling the MT

resource file. Here are the contents of my MT file:

#include <Mstn\MicroStation.r.h>
#include  "tables.h"

/* for resource */
#pragma packedLittleEndianData

createDataDef ( tables, RSCID_TABLES_PREFS );

publishStructures ( tables );
publishStructures ( levelIDD );

The MT file uses the header file tables.h:

#if !defined( __tablesH__ )
#define __tablesH__

// include files
#include <Mstn\MicroStation.r.h>
#include <Mstn\MdlApi\mdl.h>

/* local defines */
#define BIGGAP		- 1
#define TOOMANY		- 2
#define PROCESSING	100
#define NORMAL		101
#define GRADE		102
#define SUBASE		103
#define GROUND		104
#define PAUSING		105
#define ERRORCHECK	106
#define USERFILE	107
#define APPFILE		108
#define MAXVERTICES 500
#define STATUS_ON	1
#define STATUS_OFF	0
#define ERROR_LINE	- 200
#define NO_ELEMENTS - 300

/* resource defs */
#define RTYPE_TABLES_CLASS	'tmpP'
#define RSCID_TABLES_PREFS	1
#define PORTRSCID_tables	1

/* dialog ids */
#define DIALOGBOXID_tables					21
#define DIALOGBOXID_tablesGradeLevels		22
#define DIALOGBOXID_tablesSubaseLevels		23
#define DIALOGBOXID_tablesGroundLevels		24
#define DIALOGBOXID_tablesGradeSettings		25
#define DIALOGBOXID_tablesTableScale		26
#define DIALOGBOXID_tablesSubaseSettings	27
#define DIALOGBOXID_tablesErrorSettings		28
#define DIALOGBOXID_tablesGroundSettings	29
#define DIALOGBOXID_tablesXSSettings		30
#define DIALOGBOXID_tablesTitleSettings		31
#define DIALOGBOXID_tablesCenterSettings	32
#define DIALOGBOXID_tablesProcessSettings	33
#define DIALOGBOXID_tablesLimitsSettings	34
#define DIALOGBOXID_tablesTextSettings		35
#define DIALOGBOXID_tablesGradeScanSettings 36
#define DIALOGBOXID_tablesMultiLevels		37
#define DIALOGBOXID_tablesSubaseScanSettings 38

/* hook functions */
#define HOOKBUTTONSID_tables		23
#define HOOKDIALOGID_tables			20
#define HOOKTOGGLEID_tables			24
#define HOOKLISTBOXID_scanGradeText		25
#define HOOKCOMBOID_levels			27
#define HOOKLISTBOXID_levels		28
#define HOOKTOGGLEID_weedGroundText 29
#define HOOKLISTBOXID_scanSubText		30

/* command numbers */
#define CMD_CREATE_TABLES			0x0e000000
#define CMD_SELECT_TABLE_SCALE		0x0e000001
#define CMD_SELECT_GRADE_SETTINGS	0x0e000002
#define CMD_SELECT_SUBASE_SETTINGS	0x0e000003
#define CMD_SELECT_GROUND_SETTINGS	0x0e000004
#define CMD_SELECT_ERROR_SETTINGS	0x0e000005
#define CMD_SELECT_XS_SETTINGS		0x0e000006
#define CMD_SELECT_TITLE_SETTINGS	0x0e000007
#define CMD_SELECT_CENTER_SETTINGS	0x0e000008
#define CMD_SELECT_PROCESS_SETTINGS 0x0e000009
#define CMD_SELECT_LIMITS_SETTINGS	0x0e000010
#define CMD_FILE_LOAD_SETTINGS		0x0e000011
#define CMD_FILE_SAVE_SETTINGS		0x0e000012
#define CMD_TEXT_SETTINGS			0x0e000013
#define CMD_GRADE_SCAN_SETTINGS		0x0e000014
#define CMD_GRADE_SCAN_CLEAR_ALL	0x0e000015
#define CMD_GRADE_SCAN_SELECT_ALL	0x0e000016
#define CMD_SCAN_GRADE_XS			0x0e000017
#define CMD_SET_BUTTON_STATE		0x0e000018
#define CMD_SUBASE_SCAN_SETTINGS	0x0e000019
#define CMD_SUBASE_SCAN_CLEAR_ALL	0x0e000020
#define CMD_SUBASE_SCAN_SELECT_ALL	0x0e000021
#define CMD_SCAN_SUB_XS				0x0e000022
#define CMD_SELECT_SUB_PVM_TEXT		0x0e000023
#define CMD_SELECT_GRADE_PVM_TEXT	0x0e000024
#define CMD_TABLES_OPEN_GRADE_LIST		0x0e000025
#define CMD_TABLES_SAVE_GRADE_LIST		0x0e000026
#define CMD_TABLES_OPEN_SUB_LIST		0x0e000027
#define CMD_TABLES_SAVE_SUB_LIST		0x0e000028
#define CMD_TABLES_SAVE_CS_OUT		0x0e000029

/*----------------------------------------------------------------------+
| local structures                       								|
+----------------------------------------------------------------------*/
typedef struct
{
	double		xLeft;
	double		yLeft;
	double		xRight;
	double		yRight;
	DPoint3d	lowerLeft;
	DPoint3d	upperRight;
	double		baseElev;
	double		baseY;
	float		station;
	ULong		fileOffset;
	double		xsmaxy;
	double		xsminy;
	short		ggroup;
	DPoint3d	center;
} XSCELL;

typedef struct
{
	char	pvmName[10];
	int		status;
} PVM;

typedef struct
{
	DPoint3d	verts[2];
	int			vertical;
} LINEBOX;

typedef struct
{
	DPoint3d	origin;
} TEXTBOX;

typedef struct
{
	DPoint3d	vertex;
	double		offset;
} TABLELINE;

// multi levels
typedef struct mlevels
{
	UInt32	count;
	UInt32	code[10000];
} MLEVELS;

typedef struct tables
{
	/* main tables dialog */
	short	gradeLevels[4];
	short	groundLevels[4];
	short	subaseLevels[4];
	double	tolerance;
	BoolInt doGround;
	BoolInt doSubase;
	BoolInt doGrade;

	/* scale dialog */
	int		tablePlotScale;

	/* grade table settings */
	UInt32	gradeTableLevelCode;
	int		gradeTableColor;
	int		gradeTableWeight;
	UInt32	gradeTextLevelCode;
	int		gradeTextColor;
	int		gradeTextWeight;
	float	gradeTableOffset;
	int		gradeTextFont;
	float	gradeTextHeight;
	float	gradeTextWidth;
	float	gradeTextStackOffset;
	float	gradeTextHorzOffset;
	float	gradeTextVertOffset;
	float	gradeTableTickSize;

	/* subase table settings */
	UInt32	subaseTableLevelCode;
	int		subaseTableColor;
	int		subaseTableWeight;
	UInt32	subaseTextLevelCode;
	int		subaseTextColor;
	int		subaseTextWeight;
	float	subaseTableOffset;
	int		subaseTextFont;
	float	subaseTextHeight;
	float	subaseTextWidth;
	float	subaseTextStackOffset;
	float	subaseTextHorzOffset;
	float	subaseTextVertOffset;
	float	subaseTableTickSize;
	int		doSubaseLimits;

	/* ground table settings */
	UInt32	groundTableLevelCode;
	int		groundTableColor;
	int		groundTableWeight;
	UInt32	groundTextLevelCode;
	int		groundTextColor;
	int		groundTextWeight;
	float	groundTableOffset;
	float	groundTableWidth;
	int		groundTextFont;
	float	groundTextHeight;
	float	groundTextWidth;
	float	groundTextOffset;

	/* error display */
	float	errRadius;
	UInt32	errLevelCode;
	int		errColor;
	int		errWeight;
	int		errStyle;

	/* xs settings */
	int		xsSpacingX;

	/* titles settings */
	int		statTextFont;
	float	statTextHeight;
	float	statTextWidth;
	float	statTextHorzOffset;
	float	statTextVertOffset;
	int		projTextFont;
	float	projTextHeight;
	float	projTextWidth;
	float	projTextHorzOffset;
	float	projTextVertOffset;
	char	projName[50];
	int		numTextFont;
	float	numTextHeight;
	float	numTextWidth;
	float	numTextHorzOffset;
	float	numTextVertOffset;

	/* centerline settings */
	UInt32	cenLevelCode;
	int		cenColor;
	int		cenWeight;
	int		cenStyle;
	char	cenCellName[10];

	/* process settings */
	BoolInt doErrorCheck;
	BoolInt doSectionPause;

	/* limits of settings */
	UInt32	limLevelCode;
	int		limColor;
	int		limWeight;
	int		limStyle;
	int		limTextFont;
	float	limTextHeight;
	float	limTextWidth;
	float	limTextHorzOffset;
	float	limTextVertOffset;
	char	limrname[10];
	char	limlname[10];

	/* cell library */
	char	cellLibName[128];

	/* other options */
	BoolInt doProjectName;
	BoolInt doStationName;
	BoolInt doStationNumber;

	int		xsSpacingY;

	// for text scan settings
	UInt32	textScanLevelCode;
	int		textScanColor;
	BoolInt doConnectingLines;

	// new levels settings
	MLEVELS gndLevels;
	MLEVELS subLevels;
	MLEVELS grdLevels;

	// station suffix
	char	numTextSuffix[10];

	// for weeder
	BoolInt weedGroundText;
	float	weedGroundDelta;
} Tables;

typedef struct levelIDD
{
	UInt32	gradeTableLevel;
	UInt32	gradeTextLevel;
	UInt32	subaseTableLevel;
	UInt32	subaseTextLevel;
	UInt32	groundTableLevel;
	UInt32	groundTextLevel;
	UInt32	errLevel;
	UInt32	cenLevel;
	UInt32	limLevel;
	UInt32	textScanLevel;
} LevelIDD;

/* resource definition */
#if defined( resource )
resourceclass Tables	RTYPE_TABLES_CLASS;
#endif

#endif /* !defined	(__tablesH__) */

And lastly here are the contents of my MKE file:

#--------------------------------------------------
#       Define constants specific to this example
#--------------------------------------------------
PolicyFile = MicroStationPolicy.mki
DEFAULT_TARGET_PROCESSOR_ARCHITECTURE=x64
MDLMKI = $(MSMDE)mki/
mdlLibs = $(MSMDE)library/
dirToSearch = $(MDLMKI)
genSrc = $(o)
%include $(MDLMKI)mdl.mki
%include $(MDLMKI)cincapnd.mki

#--------------------------------------------------
#       Define constants specific to this example
#--------------------------------------------------
appName     = tables
sAppName    = tables

privateInc      = $(baseDir)
langSpec        = $(baseDir)transkit/

#---------------------------------------------
# Define Macros for files include in our link and resource
#---------------------------------------------
Objs  = $(o)tables.mo \
	$(o)tablesdlg.mo \
	$(o)multiLevel.mo \
	$(o)tablestxt.mo \
	$(mdlLibs)ditemlib.dlo

Rscs  =	$(basedir)tablesdlg.rsc \
	$(o)tablestyp.rsc \
	$(o)tables.mp \
    $(o)tablescmd.rsc \
    $(o)tablesmsg.rsc \
    $(o)subaseSettingsDlg.rsc \
    $(o)scanSettingsDlg.rsc \
    $(o)limitsSettingsDlg.rsc \
    $(o)groundSettingsDlg.rsc \
    $(o)gradeSettingsDlg.rsc \
    $(o)errorSettingsDlg.rsc \
    $(o)multiLevelDlg.rsc \
    $(o)clineSettingsDlg.rsc

#----------------------------------------------------------------------
# Create needed output directories in case they don't exist
#----------------------------------------------------------------------
always:
    !~@mkdir $(o)
    !~@mkdir $(rscObjects)
    !~@mkdir $(reqdObjs)

#---------------------------------------------
#       Generate Command Tables
#---------------------------------------------
$(o)tablescmd.rsc        : $(baseDir)tablescmd.r

#---------------------------------------------
#   dialog resources
#---------------------------------------------
$(o)clineSettingsDlg.rsc        : $(baseDir)clineSettingsDlg.r

$(o)errorSettingsDlg.rsc        : $(baseDir)errorSettingsDlg.r

$(o)gradeSettingsDlg.rsc        : $(baseDir)gradeSettingsDlg.r

$(o)groundSettingsDlg.rsc       : $(baseDir)groundSettingsDlg.r

$(o)limitsSettingsDlg.rsc       : $(baseDir)limitsSettingsDlg.r

$(o)scanSettingsDlg.rsc        	: $(baseDir)scanSettingsDlg.r

$(o)subaseSettingsDlg.rsc       : $(baseDir)subaseSettingsDlg.r

$(o)multiLevelDlg.rsc        	: $(baseDir)multiLevelDlg.r

#---------------------------------------------
#   prompts and command numbers
#---------------------------------------------
$(o)tablesmsg.rsc        : $(baseDir)tablesmsg.r $(baseDir)tablesmsg.h

#---------------------------------------------
#   make resource to publish structures
#---------------------------------------------
$(o)tablestyp.r          : $(baseDir)tablestyp.mt

$(o)tablestyp.rsc        : $(o)tablestyp.r

#------------------------------------------------
#   Set up to use dlmcomp.mki and dlmlink.mki
#------------------------------------------------
dlmObjs = \
    $(o)$(appName)$(oext)   \
    $(o)$(sAppName)hook$(oext)


DLM_NAME                = $(appName)
DLM_DEST                = $(mdlapps)
DLM_OBJECT_FILES        = $(dlmObjs)
DLM_OBJECT_DEST         = $(o)
DLM_SPECIAL_LINKOPT     = -fixed:no     # Notify linker this library does not require a fixed base address to load
DLM_NO_DLS              = 1             # USE DLLEXPORT IN .CPP
DLM_NO_DEF              = 1
DLM_NOENTRY             = 1
DLM_NO_MANIFEST         = 1             # If not set linker embeds your current (developer) patched MSVCRT version manifest in output dll.  This is not desirable and produces side-by-side CLIENT ERROR: 14001)
DLM_NO_SIGN             = 1             # If not set and no certificate found, ERROR: 'singleton' is not recognized as an internal or external command
LINKER_LIBRARIES        = $(mdlLibs)bentley.lib \
                          $(mdlLibs)BentleyAllocator.lib \
						  Advapi32.lib\
						  $(ntPlatformLib)ws2_32.lib\
						  $(mdlLibs)RmgrTools.lib\
						  $(mdlLibs)DgnPlatform.lib\

#----------------------------------------------------------------------
#   Compile the source files for the DLM
#----------------------------------------------------------------------

$(o)tables$(oext)         : $(baseDir)tables.cpp  $(baseDir)tables.h $(baseDir)tables.fdf

$(o)tablesdlg$(oext)         : $(baseDir)tablesdlg.cpp   $(basDir)tables.h $(basDir)tables.fdf

$(o)tablestxt$(oext)         : $(baseDir)tablestxt.cpp  $(baseDir)tables.h $(baseDir)tables.fdf

$(o)multiLevel$(oext)         : $(baseDir)multiLevel.cpp  $(baseDir)tables.h $(baseDir)tables.fdf

%include $(MDLMKI)dlmlink.mki

#---------------------------------------------
#   Merge the dialog resources & MDL program file using rlib
#---------------------------------------------
$(reqdObjs)$(appName).mi        : $(listboxRscs)
    $(msg)> $(o)make.opt
    -o$@
    $(listboxRscs)<
    $(RLibCmd) @$(o)make.opt
    ~time

#---------------------------------------------
#   Include language specific make steps
#---------------------------------------------
%include $(baseDir)$(sAppName)rsc.mki

The BMAKE command produces the following output:

W:\benzi\mdlConnect\tables>bmake
Bentley Systems Make Utility. Version 10.00.00.22, May 15 2017
Wed Feb 14 08:42:57 2018

[== Building C:\Users\benzi\AppData\Local\Temp\Bentley\MicroStationSDK\objects\tablestyp.r, (W:\benzi\mdlConnect\tables\tablestyp.mt) ==]
rsctype @C:\Users\benzi\AppData\Local\Temp\Bentley\MicroStationSDK\objects\make.opt
MicroStation Type Resource File Generator 03.12.02
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(46) : error: "This file is for C++ compilands only"
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/suppress_warnings.h(11) : warning: pragma not recognized.
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/suppress_warnings.h(12) : warning: pragma not recognized.
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/suppress_warnings.h(13) : warning: pragma not recognized.
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/suppress_warnings.h(14) : warning: pragma not recognized.
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/suppress_warnings.h(16) : warning: pragma not recognized.
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/suppress_warnings.h(17) : warning: pragma not recognized.
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/suppress_warnings.h(18) : warning: pragma not recognized.
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/suppress_warnings.h(19) : warning: pragma not recognized.
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/suppress_warnings.h(28) : warning: pragma not recognized.
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/suppress_warnings.h(33) : warning: pragma not recognized.
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/suppress_warnings.h(39) : warning: pragma not recognized.
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/suppress_warnings.h(40) : warning: pragma not recognized.
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/suppress_warnings.h(41) : warning: pragma not recognized.
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/suppress_warnings.h(43) : warning: pragma not recognized.
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/suppress_warnings.h(44) : warning: pragma not recognized.
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(70) : warning: macro ENUM_UNDERLYING_TYPE previously defined as .
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(112) : error: can't open #include file limits.h
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(112) : error: No such file or directory
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(239) : error: Data declarations must be typedefs.
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(239) : error: expected ;, got BENTLEY_NAMESPACE_NAME
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(239) : error: bad declaration
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(239) : error: Data declarations must be typedefs.
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(239) : error: expected ;, got }
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(239) : error: bad declaration
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(239) : error: expected ;, got ::
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(239) : error: bad declaration
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(239) : error: expected ;, got ::
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(239) : error: bad declaration
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(239) : error: Data declarations must be typedefs.
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(239) : error: expected ;, got }
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(240) : error: bad declaration
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(240) : error: Data declarations must be typedefs.
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(240) : error: expected ;, got }
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(240) : error: bad declaration
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(240) : error: expected ;, got ::
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(240) : error: bad declaration
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(240) : error: expected ;, got ::
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(240) : error: bad declaration
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(240) : error: Data declarations must be typedefs.
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(240) : error: expected ;, got }
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(241) : error: bad declaration
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(241) : error: Data declarations must be typedefs.
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(241) : error: expected ;, got }
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(241) : error: bad declaration
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(241) : error: expected ;, got ::
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(241) : error: bad declaration
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(241) : error: expected ;, got ::
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(241) : error: bad declaration
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(241) : error: Data declarations must be typedefs.
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(241) : error: expected ;, got }
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(242) : error: bad declaration
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(242) : error: Data declarations must be typedefs.
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(242) : error: expected ;, got }
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(242) : error: bad declaration
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(242) : error: expected ;, got ::
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(242) : error: bad declaration
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(242) : error: expected ;, got ::
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(242) : error: bad declaration
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(242) : error: Data declarations must be typedefs.
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(242) : error: expected ;, got }
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(243) : error: bad declaration
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(243) : error: Data declarations must be typedefs.
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(243) : error: expected ;, got }
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(243) : error: bad declaration
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(243) : error: expected ;, got ::
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(243) : error: bad declaration
C:\PROGRA~1\Bentley\MICROS~1\include\Bentley/Bentley.h(243): Exceeded limit for errors.
BMAKE: call trace
    line:   86, W:\benzi\mdlConnect\tables\tables.mke
Wed Feb 14 08:42:58 2018, elapsed time: 0:01

W:\benzi\mdlConnect\tables>

I have no idea what is missing or wrong with my MT file. I have tried different code changes with no success.

Any help would be greatly appreciated.

Regards,

Benzi

[CONNECT VBA] Project Load Event Handler interrupted by File Open pane

$
0
0

I have a VBA macro that shows a UserForm when loaded.  It has a class that does Private WithEvents m_hooks As Application, just as the example in VBA help.

When I start MicroStation CONNECT, the event handler does its stuff and pops the UserForm.  Then MicroStation opens its file open window pane.  The VBA UserForm disappears.  When I choose a file to open, the VBA macro does not reappear.  It's been unloaded.

This behaviour differs from previous versions of MicroStation V8, when a loaded macro could be relied on to stay loaded.  MicroStation CONNECT performs its startup differently as far as VBA is concerned.

What should I do to persuade a macro that implements WithEvents to stick around and stay loaded in CONNECT?

[CONNECT U7] View Rotations and Projections of a Line

$
0
0

Given two points in "global" coordinates, how does one determine the "apparent" XY rotation of a line drawn between them when you're in a rotated 3D view? I can determine the inverse RotMatrix of the view so that one can "remove" any visual affects of things like cells when displayed in a rotated view. But now I've got a pair of points in "global" coords that need to be "projected" onto the XY plane of a rotated view. Once I do that (not sure how to do that - yet), I'm not sure if I then determine the direction vector of those two points that it will return a rotation that is "with respect to the current rotated view's XY plane"..

Bruce

Missing Dynamic Array API in the CONNECT SDK

$
0
0

Hello guys,

I am in the process of migrating several of our MDL applications to run under Microstation CONNECT. 

My current application relies heavily on dynamic array manipulation methods:

mdlDArray_insertMembers
mdlDArray_create
mdlDArray_destroy
...

The CONNECT SDK does not seem to offer support for these methods.

Is there any another approach that can offer me a similar type of functionality?

Regards,

Benzi

[Connect up.6] problem with mdlSolid_listNthEl

$
0
0

Hi,

My system is windows 7, vs 2015 , connect update 6

I am trying to get info about solid element ( slab). 

Code:

		double UM = 0; // UORs in Master
		mdlCnv_masterToUOR (&UM, 1, MASTERFILE);


		Bentley::DgnPlatform::ElementId      id = idIn;
		MSElementDescr* pElm = NULL;
		UInt32 filePos = 0;
		mdlAssoc_getElementDescr (&pElm, &filePos, id, ACTIVEMODEL, FALSE);

		if (NULL == pElm)
		{
			mdlDialog_dmsgsPrint(L"elRef == NULL");
		return false;
		}

		MSElementDescr *remainingEdPP = NULL; /* Unconverted elements */
		ENTITY_TAG *pBody = NULL; /* The solid body */
        ENTITY_TAG* entP = NULL;

		TAG_ENTITY_LIST *bodyListPP = NULL; /* List of Bodies - Bodies should NOT be freed */
		NON_ENTITY_LIST *templateListPP = NULL; /* Template freed only if not equal to edP */
		NON_ENTITY_LIST *transformListPP = NULL; /* Entries must be NULL or a Transform list */
		Transform *pTran = NULL; /* Transformation from the parasolid */
		Dpoint3d *vertices = NULL; /* Vertices that make up a triangle */
		long *facets = NULL; /* Consisting of vertices or null*/
		long numFacets = 0; /* Number of facets */
		long numVertices = 0; /* Number of vertices */
		int status = 0, i = 0; /* Status and counter */
		int nItems = 0, c = 0; /* Count and item count for entity list */

		double mdlChordTol[1];
		double mdlMaxEdgeLen[1];
		 //mdlChordTol[0]= chordTol*UM;
		 //mdlMaxEdgeLen[0]= maxEdgeLen*UM;


		// begin KI translation
		mdlSolid_beginCurrTrans(mdlModelRef_getActive());

		//To convert a value given in UORs to kernel units, use this code:
        //mdlCurrTrans_invScaleDoubleArray (&valueInKernelUnits, &valueInUORs, 1);
		mdlCurrTrans_invScaleDoubleArray (mdlChordTol, mdlChordTol, 1);
        mdlCurrTrans_invScaleDoubleArray (mdlMaxEdgeLen, mdlMaxEdgeLen, 1);

		status = mdlSolid_elementToBodyList(&bodyListPP, &templateListPP, &transformListPP, &remainingEdPP, pElm, MASTERFILE, filePos, FALSE);
		mdlElmdscr_freeAll(&pElm);
		mdlSolid_endCurrTrans();

		  double dChordHeight =1 ;               // tolerance in master units
		  double dNormalAngle = 0.5 ;                // tolerance in radians
		  double dSideWidth =0.0 ;             // max edge in master units


		if (status == SUCCESS && bodyListPP != NULL)
		{


			/* Loop through body list */
			for ( int i = 0; SUCCESS == mdlSolid_listNthEl (pBody, bodyListPP , i) ; i++ )
			{
				if (pBody == NULL)continue;
			}
		}

However, function mdlSolid_listNthEl returns pBody = NULL. Why?

I know this does not men much but this code worked in v8i

thanks

Nenad

[Connect CPP] Create label programmaticaly

$
0
0

Hi

I've made a function that can be used to place a label with data taken from Item Types. It is listed below:

BentleyStatus lifalib_placeLabel(ElementRefP elmRefIn, char *cellName, double scale, DPoint3d ptOrigin, double offsetX, double offsetY, bool placeLeader, double rotAngleInDregrees = 0.0, UInt32 levelID = 0)
{
	MSElementDescr *pedCell;
	DPoint3d		ptScale, ptTemp;
	wchar_t			wcCellName[MAX_CELLNAME_LENGTH];
	BentleyStatus	rc = SUCCESS;

	EditElementHandle eeh(elmRefIn);

	ptTemp = ptOrigin;
	ptTemp.x -= offsetX;
	ptTemp.y -= offsetY;

	mbstowcs(wcCellName, cellName, MAX_CELLNAME_LENGTH);
	ptScale.x = ptScale.y = ptScale.z = scale;
	if (mdlCell_getElmDscr(&pedCell, NULL, &ptOrigin, &ptScale, true, NULL, NULL, NULL, 0, true, wcCellName, NULL) == SUCCESS)
	{
		ElementHandle ehCell(pedCell, true, true, ISessionMgr::GetActiveDgnModelRefP());
		EditElementHandle labelElm, leaderElm;
		DimensionStylePtr dimStylePtr = DimensionStyle::GetActive();

		// set terminator size
		double arrowSizeSave;
		dimStylePtr->GetDoubleProp(arrowSizeSave, DimStyleProp::DIMSTYLE_PROP_Terminator_Width_DOUBLE);
		dimStylePtr->SetDoubleProp(scale, DimStyleProp::DIMSTYLE_PROP_Terminator_Width_DOUBLE);
		dimStylePtr->SetDoubleProp(scale / 2, DimStyleProp::DIMSTYLE_PROP_Terminator_Height_DOUBLE);

		// get rotationsmatrice for label
		RotMatrix rmLabel = RotMatrix::FromIdentity();
		rmLabel = rmLabel.FromAxisAndRotationAngle(2, rotAngleInDregrees * fc_piover180);
		LabelCellHeaderHandler::StdDPointVector vectorPt;
		vectorPt.push_back(ptTemp);
		vectorPt.push_back(ptOrigin);

		// create label and update reference
		LabelCellHeaderHandler::GetInstance().CreateLabel(labelElm, leaderElm, *dimStylePtr, ehCell, true, rmLabel, *ISessionMgr::GetActiveDgnModelRefP(), vectorPt, !placeLeader);
		LabelCellHeaderHandler::GetInstance().UpdateFieldTarget(labelElm, eeh);

		// restore terminator size
		dimStylePtr->SetDoubleProp(arrowSizeSave, DimStyleProp::DIMSTYLE_PROP_Terminator_Width_DOUBLE);
		dimStylePtr->SetDoubleProp(arrowSizeSave, DimStyleProp::DIMSTYLE_PROP_Terminator_Height_DOUBLE);


		// set grafic group number
		UInt32 ggNum = tcb->graphic;
		ElementPropertiesSetterPtr propSetter = ElementPropertiesSetter::Create();
		propSetter->SetGraphicGroup(labelElm, ggNum);
		propSetter->SetGraphicGroup(leaderElm, ggNum);
		eeh.ReplaceInModel(elmRefIn);
		mdlSystem_updateGraphicGroup();

		// add element(s) to file
		labelElm.AddToModel();
		if (placeLeader)
			leaderElm.AddToModel();

		mdlElmdscr_freeAll(&pedCell);
	}
	else
	{
		wchar_t sMsg[120];
		swprintf(sMsg, L"Error: Unable to find the cell <%hs>", cellName);
		mdlDialog_dmsgsPrint(sMsg);
		rc = ERROR;
	}

	return rc;
}

Below you'll find one way to call this function:

#define SCALE mdlModelRef_getUorPerMaster(mdlModelRef_getActive())
	virtual StatusInt _DoOperationForModify(EditElementHandleR eeh) override
	{
		DPoint3d cellOrigin;
		NormalCellHeaderHandler::GetInstance().GetSnapOrigin(eeh, cellOrigin);
		cellOrigin.x += 1.1*SCALE;
		cellOrigin.y += 1.0*SCALE;
		lifalib_placeLabel(eeh.GetElementRef(), "LandInd_alle", 0.1, cellOrigin, 1.1*SCALE, 1.0*SCALE, true, 0.0, eeh.GetElementRef()->GetLevel());

		return SUCCESS;
	}

It seems to work fine - a label is added to the design file together with a leader. But when I move the label-element the leader remains unchanged - it is moved together with the label-element, but I want the leader and terminator to be modified in the same way as if it was placed manually. In this case the teminator (the arrow) still points to the element the data is extracted from.

communities.bentley.com/.../3386.CreateLabelTest.zip

I've attached a .zip file that includes Visual Studio project (CreateLabelTest), a design file used testing (CreateLabelTest.dgn), cellibrary (CreateLabelTest.cel) and LabelHandler.h (with small necessary changes if you want to compile the solution).

I indeed hope that someone can help me so that the labels created by the program "works" the same way as if it was placed manually..

TIA

Evan


[CONNECT U7 C++] Rerference File Attachments

$
0
0

In V8i I was able to specify a reference file attachment method by:

			ReferenceFile		*pRefFile=mdlRefFile_getInfo( attachedModelRefP );
			if ( pRefFile )
			{
				pRefFile->display.fb_opts.attachMethod = ATTACHMETHOD_CoincidentWorld;
                ...
            }

but I don't see ATTACHMETHOD_CoincidentWorld nor do I see anything like display.fb_opts.attachMethod in a CONNECT DgnAttachmentP struct.

Bruce

MicroStation Connect SDK v10.07.00.40

$
0
0

I am having trouble building all of the examples.  I used the following steps:

I started the MicroStation shell developer as Administrator and entered the following:

MicroStationDeveloperShell.bat C:\Program Files\Bentley\MicroStation C:\Program Files\Bentley\MicroStationCONNECTSDK

This sets up the environment variables MS, MSMDE and MSMDE_OUTPUT and the PATH.  I do not see any errors.

When I try to build all of the examples, I get the following:

Bentley Systems Make Utility.  Version 10.00.00.22, May 15 2017

Thu Feb 15 14:14:10 2018

unhandled exception code 0x0434352

BMAKE: call trace

     line:   310, C:\PROGRA~1\Bentley\MICROS~2\mki\AssertToolSet.mki

     line:   114, C:\PROGRA~1\Bentley\MICROS~2\mki\ConfigurePolicy.mki

     line:     26, C:\PROGRA~1\Bentley\MICROS~2\mki\mdl.mki

     line:     15, C:\PROGRA~1\Bentley\MICROS~2\mki\Miscellaneous\scanfile\scanfile.mke

dump file for process id 53232 thread id 52728

dump type 0x000a2927

dump file could not be written to C:\Users\LARRY~1.SMA\AppData\Local\Temp\bmake_TID_52728.dmp (error=-2147024809=0x80070057)

I get a similar error for every example.  I looked at the file permissions for the Temp directory, and Admin has full access.  Can anyone help me with this error?

Thanks.

[V8i C#] Manipulate DGN Without Making it Active

$
0
0

Greetings,

I would like to add elements to a file opened with `Bentley.MicroStation.InteropServices.Utilities.ComApp.OpenDesignFileForProgram()`.
I have a functional solution that allows users to batch export all cells from a cell library using `.OpenDesignFile` and the current UX leaves a bit to be desired due to the active design file changing rapidly.
I encounter the error `System.Runtime.InteropServices.COMException (0x80040000): Operation requires the active design file` when attempting to use the desired method.

AECOSim Drawing Extraction Manager Output Folder

$
0
0

Is there a way to have the Drawing Output Folder updated for multiple extractions and multiple drawings in batch?

Thanks.

MicroStation Connect SDK v10.07.00.40

$
0
0

When I run bmake, I get an unhandled exception code 0xe0434352.  Can anyone explain to me what this error is?  I'm running MicroStation Connect Update 7, VS 2017 with Windows 7 Professional Service Pack 1.

Help me! Import points in microstation v8i by VBA?

$
0
0

How to Import points in microstation v8i? thanks.

Ex:

Point    Coordinates

1    529927,1795280
2    529904,1795266
3    529890,1795248
4    529883,1795215
5    529856,1795200
6    529844,1795199
7    529823,1795217
8    529816,1795223

[v8i ss3 MDL] Solid element rotation matrix

$
0
0

Hi,

My system is windows 7, vs 2005, v8i

I have solid element (type 19, rectangular slab)  and I need to extract/ get  rotation matrix.

Is there mdl function I could use?

thanks

Nenad


[v8i ss3 MDL] mdlKISolid_satDataFromElement hangs and never returns.

$
0
0

Hi,

I am using Microstation ss3 v8i.

I am trying to use the API mdlKISolid_satDataFromElement() to get sat data out of a smart solid element.

For most of the smart solid cases it's working as expected but for a particular element, API hangs and never return out from the API. I do have cases where it returns with an error and accordingly, i am handling but for few case, API hangs and never returns.

So all I want is, is there a way to get out of this situation like if the input is not proper or processing fails API should return out error instead of hanging.

Could you please help me out in how to handle such cases.

usage: 

iStatus = mdlKISolid_satDataFromElement(&m_pvSatData, &iSatDataSize, NULL, &m_tSatTransform, NULL, 6, 0, FALSE, FALSE );

Thanks & regards,

Bhargav

MVBA - Returning Cell names from a Cell library without making it Active?

$
0
0

Hi,

I haven;t been coding for a while so be kind. Just trying to Enumerate through a cell (.cel) file to populate a UserForm ComboBox without the user noticing much change. ie not switching ActiveDesignFile.

It's prob dead easy but I have searched and attempted to modify Mr. Summers code but as I said it's been a while. 

Here is the code I have started -

Sub SignCellPlacement()

Dim cellLibPath As String
Dim nCells As Long
Dim index As Integer
Dim cellName As String
Dim cellModel As ModelReference

cellLibPath = ActiveWorkspace.ExpandConfigurationVariable("$(_USTN_PROJECTDATA)cell/Signs/Signs-Guide-All.cel")


ActiveModelReference.Activate (cellLibPath)

nCells = EnumerateModels(cellLibPath)


InsertSignForm.Show

End Sub

Function EnumerateModels(dgn As ModelReference) As Integer
Dim index As Integer
Dim strName As String
For index = dgn.Models.Count To 1 Step -1
Dim oModel As ModelReference
Set oModel = dgn.Models(index)
Debug.Print "Model [" & CStr(index) & "] '" & oModel.Name & "'"
Next
EnumerateModels = dgn.Models.Count
End Function

[v8i ss3 MDL] Cleanup problem

$
0
0

Hi,

My system is windows 7, VS 2005, v8i ss3

I am having a problem with code below.

When I run this code twice it does not work, First run is ok but second run

code fails in line "if (mdlKISolid_isSolidBody (pBody) != TRUE)"

Since code woks fine in the first run, I suspect problem is in cleanup, I do not clean everything after first run and code fails second time.

I have tried everything I know but with no success.

		double UM = 0; // UORs in Master 
		mdlCnv_masterToUOR (&UM, 1, MASTERFILE); 


        ElementID      id = idIn;
		MSElementDescr* pElm = NULL;
		UInt32 filePos = 0;
		mdlAssoc_getElementDescr (&pElm, &filePos, id, ACTIVEMODEL, FALSE);

		if (NULL == pElm)
		{
		mdlDialog_dmsgsPrint ("elRef == NULL");
		return false;
		}

		MSElementDescr *remainingEdPP = NULL; /* Unconverted elements */ 
		KIBODY *pBody = NULL; /* The solid body */
		KIENTITY_LIST *bodyListPP = NULL; /* List of Bodies - Bodies should NOT be freed */ 
		KIENTITY_LIST *templateListPP = NULL; /* Template freed only if not equal to edP */ 
		KIENTITY_LIST *transformListPP = NULL; /* Entries must be NULL or a Transform list */ 
		Transform *pTran = NULL; /* Transformation from the parasolid */
		Dpoint3d *vertices = NULL; /* Vertices that make up a triangle */
		long *facets = NULL; /* Consisting of vertices or null*/
		long numFacets = 0; /* Number of facets */
		long numVertices = 0; /* Number of vertices */
		int status = 0, i = 0; /* Status and counter */
		int nItems = 0, c = 0; /* Count and item count for entity list */

		double mdlChordTol[1];
		double mdlMaxEdgeLen[1];
		 //mdlChordTol[0]= chordTol*UM;
		 //mdlMaxEdgeLen[0]= maxEdgeLen*UM;


		// begin KI translation 
		mdlKISolid_beginCurrTrans (mdlModelRef_getActive());

		//To convert a value given in UORs to kernel units, use this code: 
        //mdlCurrTrans_invScaleDoubleArray (&valueInKernelUnits, &valueInUORs, 1);
		mdlCurrTrans_invScaleDoubleArray (mdlChordTol, mdlChordTol, 1);
        mdlCurrTrans_invScaleDoubleArray (mdlMaxEdgeLen, mdlMaxEdgeLen, 1);

		status = mdlKISolid_elementToBodyList ( &bodyListPP , NULL, &transformListPP, &remainingEdPP, pElm, MASTERFILE, filePos, KISOLID_CACHE_NOCOPY, TRUE, TRUE ); 
		mdlElmdscr_freeAll(&pElm);
		mdlKISolid_endCurrTrans();

		  double dChordHeight =1 ;               // tolerance in master units
		  double dNormalAngle = 0.5 ;                // tolerance in radians
		  double dSideWidth =0.0 ;             // max edge in master units

	

		if (status == SUCCESS && bodyListPP != NULL) 
		{ 


			/* Loop through body list */
			for ( int i = 0; SUCCESS == mdlKISolid_listNthEl (&pBody, bodyListPP , i) && SUCCESS == mdlKISolid_listNthEl ((void**)&pTran, transformListPP, i); i++ ) 
			{ 

				/* Check to see if we have a solid body */
				if (mdlKISolid_isSolidBody (pBody) != TRUE)
				{
					printf ("Wrong Type\n");continue;}
				    int ent;


					status = mdlKISolid_facetBody( &vertices, &numVertices, &facets, &numFacets, pBody, pTran, 10, dChordHeight, dNormalAngle , dSideWidth );
						if (numVertices == 0 || vertices == NULL)continue;

						/* Begin Cur Trans */
						mdlKISolid_beginCurrTrans (mdlModelRef_getActive());
						mdlCurrTrans_transformPointArray (vertices, vertices, numVertices);
						mdlKISolid_endCurrTrans ();

					

						mdlKISolid_freeFacetArray(facets); 
						mdlKISolid_freeFacetArray(vertices); 
				} // end for

				if (pBody)mdlKISolid_freeBody( pBody ); 
				if (bodyListPP)
				{
					/* Get count of bodies in entity list */
					mdlKISolid_listCount(&nItems, bodyListPP);

					/* Loop through entity list and delete bodies */
					for(c = 0; c < nItems; c++)
					{
					KIENTITY *entP = NULL;
					mdlKISolid_listNthEl(&entP, bodyListPP, c);
					mdlKISolid_deleteEntity(entP);
					}
					/* Delete entity list */
					mdlKISolid_listDelete(&bodyListPP);
				}
		 }// end if


		// delete lists 
		if (bodyListPP ) mdlKISolid_listDelete(&bodyListPP ); 
		//if (transformListP) mdlKISolid_listDelete(&transformListP);
		mdlElmdscr_freeAll(&remainingEdPP);

thanks

Nenad

Configuring Microsoft Visual Studio Code to run BMAKE

$
0
0

Hi guys,

I've been using Microsoft Visual Studio Code to edit my CONNECT SDK applications.

At the moment I need to run the BMAKE command externally using the supplied SDK shell.

It's a bit tedious and does not allow me the option to click on an error and be taken directly to the affected code.

Is there any way to configure VSCODE to run the BMAKE command using its integrated terminal?

Are there other alternatives to VSCODE that offer this functionality?

Regards,

Benzi

[Connect C#] Retrieving ItemType properties in same order as they are defined

$
0
0

I am trying to read the ItemTypes for an element in the same order they are defined in the item types dialog.

https://imgur.com/a/6XX8M

Whenever I iterate through the properties, most will stay in the same order, but some properties are not. For example, In the image above, the "POLE_MATERIAL" property is being placed near the end.

CustomItemHost itemHost = new CustomItemHost(el, false);
List<IDgnECInstance> tags = itemHost.CustomItems;
foreach (IDgnECInstance tag in tags)
{
	string setName = tag.ClassDefinition.Name;
	foreach (IECPropertyValue property in tag)
	{
		Debug.print(property.AccessString);
	}
}

Any help would be great!

Thanks!

Viewing all 7260 articles
Browse latest View live


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