The data was in the AttributeID Hex: 57FA Int: 22522.
Thanks again for all the help.
RE: VBA and Reading DMRS Linkages - Can it be done
RE: [CONNECT C++] How to set version number of application
[quote user="Frode Tørresdal"]I would also like to know if there is an easy way to set the version on the dll making it visible on the properties of the DLL.[/quote]
Version info is stored in resource data in a Windows DLL. If you look at a Visual C++ project in Viz Studio you will find a Version resource in a plain text .rc file. You can add your own resource to a project that is built using bmake and not Viz Studio. Here's the code for version and app. info from a .rc file...
VS_VERSION_INFO VERSIONINFO FILEVERSION 15,01,14,0 PRODUCTVERSION 8,11,1,0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L #else FILEFLAGS 0x0L #endif FILEOS 0x4L FILETYPE 0x2L FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "080904b0" BEGIN VALUE "Comments", "Implements Regression Analysis in MicroStation" VALUE "CompanyName", "LA Solutions Ltd" VALUE "FileDescription", "MicroStation Regression Analysis" VALUE "FileVersion", "15.01.14.0" VALUE "InternalName", "Regression Analysis" VALUE "LegalCopyright", "Copyright (C) 2015 LA Solutions Ltd" VALUE "OriginalFilename", "Regression.dll" VALUE "ProductName", "Regression Dynamic Link Library" VALUE "ProductVersion", "8.11.1.0" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x809, 1200 END END
This is the bmake line that compiles the above source to a Visual C++ binary .res file...
#---------------------------------------------------------------------- # Compile the Windows resource files for the DLM #---------------------------------------------------------------------- $(o)$(appName).res : $(baseDir)$(appName).rc $(baseDir)resource.h
Include that binary file in your DLL resource list with bmake like this...
#------------------------------------------------ # Set up to use dlmcomp.mki and dlmlink.mki #------------------------------------------------ dlmObjs = \ $(o)$(appName)$(oext) \ $(o)$(appName).res
RE: Macro help
Of course, I meant no point are needed for any circles just text.
I do not know why my posts are gray :D
Hi Martin
I guess wrong I use your code. The error "user-defined type not defined"
RE: Macro help
[quote user="kamil"]I guess wrong I use your code[/quote]
I copied Martin's code and it works for me.
Some clarification: two MicroStation VBA modules are needed in your VBA project...
- A class module named Ident
- A normal code module (can have any name)
Copy Martin's class code (everything after Option Explicit) into your module named Ident.
Copy Martin's Sub start to the normal module.
To run the code, key-in vba run start
RE: Macro help
RE: Macro help
My fault: change the class module name to IdentPoint.
RE: Macro help
RE: Macro help
[quote user="kamil"]to sew planted to grow to the direction of text[/quote]
It's not clear what is working correctly and what you mean by 'to sew planted to grow to the direction of text'. The screenshots are confusing.
Why not post a DGN file that shows how you want the text to appear. Maybe use one colour for original text and another colour for new text?
Inserting and Attaching Images, Videos or Files
RE: Macro help
RE: Grid display will not stay turned off
[quote user="Brian MacCartney"]Is there a key-in that just turns the grid display off?[/quote]
set grid off|on|toggle
You must select a view.
If you know the view before hand, you can key-in something like this...
set grid on; selview 1
[quote user="Brian MacCartney"]I have a basic command routine[/quote]
You're digging a hole for yourself using MicroStation BASIC. MicroStation VBA has a future, and is just as capable of queuing commands...
Option Explicit 'updated 06-Oct-2016 'created 01/23/2015 '************************************************************************************************* Public Sub SetupViews() '************************************************************************************************* Debug.Print "SetupViews" ' BEGIN SET UP OF VIEW ONE DISPLAY ' PLACE VIEW ONE DISPLAY SETTINGS HERE ' SETS THE DISPLAY WINDOW FOR VIEW ONE CadInputQueue.SendCommand "view off all " ' Begin Setup of view N Const nView As Long = 1 Debug.Print "Setup view " & CStr(nView) CadInputQueue.SendCommand "VIEW ON " & CStr(nView) CadInputQueue.SendCommand "WINDOW TILE " CadInputQueue.SendCommand "FIT VIEW EXTENDED " CadInputQueue.SendCommand "filedesign " CadInputQueue.SendCommand "dialog openfile " CadInputQueue.SendCommand "set grid on; selview " & CStr(nView) End Sub
Grid display will not stay turned off
The grid display will not stay turned off after turning it off in all views and saving the settings. Each time I have done this it comes back on. I do not need to use it when I am working the 3d model where it is particularly distracting.
I know about the view attributes but is there a key-in that just turns the grid display off?
The View Attributes command and the key-in are toggles and are of no help with this.
I have a basic command routine that fits the drawing to full view when I click the Open command icon:
'created 01/23/2015
'*************************************************************************************************
Sub main
'Dim startPoint As MbePoint
'Dim point As MbePoint, point2 As MbePoint
'*************************************************************************************************
' BEGIN SET UP OF VIEW ONE DISPLAY
' PLACE VIEW ONE DISPLAY SETTINGS HERE
' SETS THE DISPLAY WINDOW FOR VIEW ONE
' Start a command
MbeSendCommand "view off all "
' BEGIN SET UP OF VIEW ONE
' BEGIN SET UP OF VIEW ONE
' BEGIN SET UP OF VIEW ONE
MbeSendCommand "VIEW ON 1 "
MbeSendCommand "WINDOW TILE "
MbeSendCommand "FIT VIEW EXTENDED "
'========================
'REVISED 09/28/2016 REMOVED ALL SETTINGS FOR AXIS SNAPS AND ASSOCIATION
'========================
' MbeSendKeyin "CT=J:/color.tbl " '08/28/2015 blm
' MbeSendCommand "lock axis off "
' MbeSendCommand "active axis 90 "
' MbeSendCommand "accusnap off "
' MbeSendCommand "lock snap keypoint "
' MbeSendCommand "lock association on "
MbeSendCommand "filedesign "
MbeSendCommand "dialog openfile "
' END SET UP
End Sub
RE: Macro help
Ok I fixed everything. Now is OK Thank you all for your help.
RE: VBA and Reading DMRS Linkages - Can it be done
Two type of attribute linkages are User Data Linkages (UDLs) and DMRS linkages. DMRS linkages are special linkages that if the User bit of the header is not set then the linkage (ID 0) is used and respected, where typically set for UDL processing you require a "magic number" assigned by Bentley in the 2nd word of the linkage header (e.g. like 0x57FA/0d22522 assigned to Pelican Forge). Once Bentley assigns a unique ID we do not know how each application developer proceeds to implement their own custom data structure(s). We simply maintain a unique registry of IDs to avoid conflict between applications and record original requestor contact details.
My "safe coding" recommendations would be to investigate which Bentley products (and APIs or SDKs) may be able to provide access to your industry/market specific data in a reliable manner allowing you to take control of that valuable business data/intelligence and leverage within your operations and workflows.
So IMHO the question should possibly be:
Is there a Bentley product and API/SDK available that can properly access and decode my Industry/Market specific Application data so I can access, transform, and perform event-based processing of the data within my business systems?
If the originating application is a Plant, Piping, Raceway, etc. industry/market type of application; consider looking into Bentley product offerings for a given similar market to determine if a.) the product supports the originating data format , and b.) ask if that product also provides an API or SDK allowing programmatic access.
HTH,
Bob
RE: [V8i MicroStationAPI] ElementFacetOptions
When you create your class implementation that inherits ElementFacetOptions, you can choose to either define default "public:" stub methods behaviors, or expand on the stub providing your own more full and complete custom implementation still bound by virtual function signature and return types and values necessary.
When creating your class implementation try to avoid "magic numbers":
e.g. int GetMaxPerFace () override { return 3; }
Choose to implement parameterized values:
e.g. int GetMaxPerFace () override { return m_GetMaxPerFace; }
Or, even static macro values:
e.g. int GetMaxPerFace () override { return MAX_VERTICES; }
Granted additional SDK documentation and code samples for this specific area would be helpful, I was unable to find anything quickly to pass along. Hopefully the following method stubs I provide for the ones you referenced can help get you further in testing and allow you to tune and meet your needs.
HEADER FILE: ElementGraphics.h
... virtual double GetChoordHeightTolerance ()=0 virtual double GetNormalAngleTolerance ()=0 virtual bool NormalsRequired ()=0 virtual bool ParamsRequired ()=0 ...
SOURCE FILE: MyGPA.cpp
... // Better to use parameter (type) overrides, for brevity showing static variables: static double s_ChoordHeightTolerance = 0.0; static double s_angleTolerance = .2; static bool s_NormalsRequired = false; static bool s_ParamsRequired = false; ...
public:
...
// Better to avoid magic numbers and use parameter override or method variable, but showing using static variables
//double GetChoordHeightTolerance () override { return 0.0; } // Avoid magic numbers
double GetChoordHeightTolerance () override { return s_ChoordHeightTolerance; } // Default behavior, expand for override handling
double GetNormalAngleTolerance () { return s_angleTolerance; }
bool NormalsRequired () override { return s_NormalsRequired; }
bool ParamsRequired () override { return s_ParamsRequired; }
...
HTH,
Bob
[V8i MicroStationAPI] ElementFacetOptions
I'm passing a class that inherits from ElementFacetOptions to my ElementGraphicsProcessor. I need a custom version because I want the facetiser to produce triangles, so I do this...
class CMyClass: public Bentley::Ustn::ElementFacetOptions { virtual int GetMaxPerFace () { return 3; }; };
However, there are a number of additional pure virtual functions that I must also implement...
virtual double GetChoordHeightTolerance ()=0 virtual double GetNormalAngleTolerance ()=0 virtual bool NormalsRequired ()=0 virtual bool ParamsRequired ()=0
But I don't know what those values should be, and I can't see the defaults. I don't even understand what the last ParamsRequired is asking.
Those methods are pure virtual and don't have an implementation in Bentley::Ustn::ElementFacetOptions. That is, I can't do this...
virtual double CMyClass::GetChoordHeightTolerance () { return __super::GetChoordHeightTolerance (); // not implemented }
RE: CreateTextElement1 Issue
Hi,
I have try change the blank dgn file (i was using our company V8 one) and nothing changes.
I have debug some points, printing data before / after creation the element, using code like this:
Point3d origin = otherPoint; origin.X += 1.5; element = (Element)Microstation.App.CreateTextElement1(null, "text", ref origin, ref matrizIdentidad); printDebug(element, origin);
where the coords printed for element are like element.AsTextElement().get_Origin().X
and i have get this results:
Origin: 281514,7 4826608,78 -> Created: 281514,7 4826608,78 -> Dif: 0 0
Origin: 281497,2801 4826638,02 -> Created: 277597,88980459 4826638,02 -> Dif: 3899,39029541012 -9,31322574615479E-10
Origin: 281498,7801 4826638,02 -> Created: 281498,7801 4832137,47 -> Dif: 0 -5499,45000000019
Origin: 281508,9801 4826638,02 -> Created: 281508,9801 4832137,47 -> Dif: 0 -5499,45000000019
Origin: 281510,7401 4826638,02 -> Created: 281510,7401 4832137,47 -> Dif: 0 -5499,45000000019
Origin: 281511,7801 4826638,02 -> Created: 281511,7801 4832137,47 -> Dif: 0 -5499,45000000019
Origin: 281523,4101 4826638,02 -> Created: 281523,4101 4832137,47 -> Dif: 0 -5499,45000000019
Origin: 281529,6701 4826638,02 -> Created: 281529,6701 4832137,47 -> Dif: 0 -5499,45000000019
Origin: 281533,3401 4826638,02 -> Created: 281533,3401 4832137,47 -> Dif: -5,82076609134674E-11 -5499,45000000019
Origin: 281492,5801 4826600,6 -> Created: 281492,5801 4832100,05 -> Dif: 0 -5499,45000000019
Origin: 281539,1401 4826600,6 -> Created: 281539,1401 4830000,26 -> Dif: 0 -3399,66000000015
Origin: 281514,7 4826608,78 -> Created: 281514,7 4830008,44 -> Dif: 0 -3399,66000000015
Origin: 281497,2801 4826638,02 -> Created: 277597,88980459 4826638,02 -> Dif: 3899,39029541012 -9,31322574615479E-10
Origin: 281498,7801 4826638,02 -> Created: 281498,7801 4832137,47 -> Dif: 0 -5499,45000000019
Origin: 281508,9801 4826638,02 -> Created: 281508,9801 4832137,47 -> Dif: 0 -5499,45000000019
Origin: 281510,7401 4826638,02 -> Created: 281510,7401 4832137,47 -> Dif: 0 -5499,45000000019
Origin: 281511,7801 4826638,02 -> Created: 281511,7801 4832137,47 -> Dif: 0 -5499,45000000019
Origin: 281523,4101 4826638,02 -> Created: 281523,4101 4832137,47 -> Dif: 0 -5499,45000000019
Origin: 281529,6701 4826638,02 -> Created: 281529,6701 4832137,47 -> Dif: 0 -5499,45000000019
Origin: 281533,3401 4826638,02 -> Created: 281533,3401 4832137,47 -> Dif: -5,82076609134674E-11 -5499,45000000019
Origin: 281492,5801 4826600,6 -> Created: 281492,5801 4832100,05 -> Dif: 0 -5499,45000000019
Origin: 281539,1401 4826600,6 -> Created: 281539,1401 4830000,26 -> Dif: 0 -3399,66000000015
Origin: 281514,7 4826608,78 -> Created: 268217,201757813 4830608,38 -> Dif: 13297,4982421875 -3999,59999999963
Origin: 281518,286797967 4826620,36680138 -> Created: 274769,694146599 4826620,36680138 -> Dif: 6748,59265136719 0
Origin: 281518,286797967 4826620,36680138 -> Created: 279218,712090935 4826620,36680138 -> Dif: 2299,57470703125 0
Origin: 281516,505546185 4826622,75587827 -> Created: 277217,130839154 4830622,35587827 -> Dif: 4299,37470703124 -3999,60000000056
Origin: 281516,505546185 4826622,75587827 -> Created: 279216,930839154 4826622,75587827 -> Dif: 2299,57470703125 0
Origin: 281514,7 4826608,78 -> Created: 249420,741748047 4830608,38 -> Dif: 32093,9582519531 -3999,59999999963
Origin: 281521,654144905 4826615,62948652 -> Created: 274773,061493538 4826615,62948652 -> Dif: 6748,59265136719 0
Origin: 281521,654144905 4826615,62948652 -> Created: 279222,079437874 4826615,62948652 -> Dif: 2299,57470703125 0
RE: CreateTextElement1 Issue
Hi Ángela,
it probably does not relate to the discussed issue, but I'd like to ask you why do you use the casting to general Element type and not use TextElement?
element = (Element)Microstation.App.CreateTextElement1(null, "text", ref origin, ref matrizIdentidad);
In my opinion it leads to a dirty code and also such code will be always slower.
Just to test the problem is not caused by casting (frankly, I don't know about any reason why it should be ;-), can you try to use TextElement instead of Element?
With regards,
Jan
RE: CreateTextElement1 Issue
First thanks for the atention.
I am casting becouse the method has more complexity than I have explained here.
I have done that test supresing the cast to Element and nothing changes.
I have test too, a VBA code doing the same than the .NET code, a works fine.
RE: CreateTextElement1 Issue
Coud be that I am using
DesignFile planoParcelaDesignFile = Microstation.App.OpenDesignFileForProgram(planoParcelaFXC, false);
?
RE: CreateTextElement1 Issue
[quote user="Ángela Alonso Fernández"]
CouLd be that I am using
OpenDesignFileForProgram(planoParcelaFXC, false)?
[/quote]
Yes. Unless you have good reason to open a working file, prefer to use OpenDesignFile().
i