I have done a test creating and openning a file for programm and writing there some texts and works fine.
I am very lost, I don't know what more to test
Hi,
[quote user="M k"]Any suggestions?[/quote]
I am not quite sure what suggestion do you expect. In my opinion the article mentioned by Jon provides introductionary information how to call one applicaiton from another and it's in fact does not relate anyhow to MicroStation itself, so more details can be obtained from many Internet sources.
It's not clear what is you MicroStation VBA knowledge and what values do you need to search for (text, tags, element attributes, some statistics...), so it's hard to advice more than general workflow only:
With regards,
Jan
I have C# code that works fine since Microstation V8 to Microstation V8i but in new versión Microstation PowerDraft Connect 10.00.00.52 or updated one, 10.02.00.39, not:
Point3d tipoDePlanoPoint = new Point3d(); tipoDePlanoPoint.X = 100; tipoDePlanoPoint.Y = 100; Matrix3d matrizIdentidad = Microstation.App.Matrix3dIdentity(); element = (Element) Microstation.App.CreateTextElement1(null, "PLANO PARCELA", ref tipoDePlanoPoint, ref matrizIdentidad);
...
After element creation, the get_Origing() values X, Y arent 100, 100, they take aleatory values near 100, 100. Why?
I had tried, unsuccesfully:
When I was trying to play how to use WPF to create a toolbox with VS 2015 Tools for MicroStation CONNECT Edition , I found that I couldn't fix or change the Window size. Glad if someone could provide the comment as following:
namespace MSAddinSample { public partial class Toolbox : UserControl { private static Bentley.MstnPlatformNET.WPF.DockableToolbar currentControl; private static Bentley.ResourceManagement.IMatchLifetime BRI; private Bentley.MstnPlatformNET.AddIn m_addIn; public Toolbox(Bentley.MstnPlatformNET.AddIn addIn) { m_addIn = addIn; InitializeComponent(); } internal static void ShowWindow(Bentley.MstnPlatformNET.AddIn addIn) { if (null != currentControl) { currentControl.Focus(); return; } currentControl = new Bentley.MstnPlatformNET.WPF.DockableToolbar(); currentControl.ResizeMode = System.Windows.ResizeMode.NoResize; currentControl.WindowStyle = System.Windows.WindowStyle.ToolWindow; currentControl.Content = new Toolbox(addIn); currentControl.Attach(BRI, 'control'); currentControl.Show(); //currentControl.WindowContent.CanDockVertically = false; } private void Toolbox_Unloaded(object sender, System.Windows.RoutedEventArgs e) { currentControl = null; } private void Toolbar_SizeChanged(object sender, System.Windows.SizeChangedEventArgs e) { currentControl.Width = 200; currentControl.Height = 30; } }
[View:/cfs-file/__key/communityserver-discussions-components-files/343173/Sakhalin_2D00_MPQ_2D00_irregular_2D00_solid.dgn:117:0]
The attached DGN file default model contains an anomalous type 19 green solid. When I facetise this using the ElementGraphicsProcessor API it behaves oddly. I have asked the ElementGraphicsProcessor to produce triangles, but this solid results in 20 vertices that don't form a set of triangles.
I realise that it's an odd construction, and I don't know its provenance. It was probably created by another CAD tool. Is there a way in which I can ask the ElementGraphicsProcessor to tell me when it can't do what I ask?
(Please visit the site to view this file)Well here I am with good and bad news.
In the posted file you'll find a very simplified .NET project (Visula Studio 2012), a .bat to register the .dll, a .mvba to run the application and a folder with original .dgn file and two generated files (this files were generated with the original program)
With this simplified code I can't reproduce the error (arggggg).
Desription of the original program:
I wil work with this simplified code, to try reproduce on it the error detected originally.
[quote user="Jairo Martínez Fernández"]You'll find a very simplified .NET project (Visula Studio 2012), a .bat to register the .dll, a .mvba to run the application [/quote]
[quote user="Jairo Martínez Fernández"]Create two .fxc files[/quote]
What is an .fxc file?
My MicroStation VBA knowledge, very basic, like my English.
The values that I have to look for are texts.
An example of what I would get:(Please visit the site to view this file)
Regards,
M k
[quote user="M k"]My MicroStation VBA knowledge is very basic[/quote]
Then I suggest that you break your project into manageable pieces...
To help with the first task, read this article about Text Search & Replace for MicroStation.
[View:/cfs-file/__key/communityserver-discussions-components-files/343173/spherical_5F00_tank_2D00_simplified.dgn:235:0]
The attached DGN file's default model shows a small number of solid elements. Focus on the red 'sphere'. It turns out to be constructed from a torus (mdlSurface_revolutionIsTorus() returns TRUE), although I don't understand how nor do I know its provenance.
However, the torus has negligible volume, even though it's several metres in diameter. Why does it measure no volume? Is it the MicroStation equivalent of a Klein bottle?
The blue sphere was created using MicroStation's tool for comparison purposes, and behaves as one would expect.
I am using the Helix method and CreateBsplineCurveElement1 to create a helical curve. I create, for example, a helix
with start and end radius of 1, a start point of {1,0,0} and an axis from {0,0,0} to {0,0,1} and a pitch of 1. If I
now create another helix changing only the height, such as an axis from {0,0,0} to {0,0,1/3}, then the resulting helix
passes through the first helix at the start, end and midpoints but is higher or lower everywhere else, as shown in the
image below.
This seems to be related to the question here:
http://communities.bentley.com/products/products_generativecomponents/f/360/t/96280
It appears to me that the Helix method incorrectly calculates the control points and/or weights for the
resulting B-Spline.
Any ideas on how to fix this?
![]()
Jon,
I am using V8i version 08.11.09.459
I am accessing the API through .NET linked to Mathematica so my code wouldn't be of much use to most, but here is a modification of the relevant parts of the "Flattening Elements" example for Helix in the VBA docs that resembles how I am using it:
startPt = Point3dFromXYZ(1, 0, 0) axis = Segment3dFromXYZXYZStartEnd(0, 0, 0, 0, 0, 1) oBsplineCurve.Helix 1, 1, startPt, axis, 1, False Set oElement = CreateBsplineCurveElement1(Nothing, oBsplineCurve) oElement.color = 0 ActiveModelReference.AddElement oElement oElement.Redraw axis = Segment3dFromXYZXYZStartEnd(0, 0, 0, 0, 0, 0.33333333333) oBsplineCurve.Helix 1, 1, startPt, axis, 1, False Set oElement = CreateBsplineCurveElement1(Nothing, oBsplineCurve) oElement.color = 3 ActiveModelReference.AddElement oElement oElement.Redraw
[quote user="Jon Summers"]20 is not divisible by three, so it's not a set of triangles.[/quote]
Depending on how the points are indexed, it doesn't have to be...
-B
[quote user="Brien Bastings"]Depending on how the points are indexed, it doesn't have to be...[/quote]
My class that inherits from ElementFacetOptions contains...
virtual int GetMaxPerFace () { return 3; };
The point indexing works for all other solids I pass to it, and produces a set of triangles for each. Why should this one be different? Does the facetting throw out a rectangle occasionally, along with the triangles?
[quote user="D C"]I am accessing the API through .NET linked to Mathematica ...[/quote]
Impressive!
However, I suggest that you initially write your code in MicroStation VBA, using the MicroStation VBA IDE. Once that's working you can port it to another environment.
[quote user="D C"]Here is a modification of the relevant parts of the "Flattening Elements" example for Helix in the VBA docs that resembles how I am using it[/quote]
Code that resembles something else is not the code you're attempting to debug. Nor is it something that we can sensibly analyse and comment on.
[quote user="D C"]my code wouldn't be of much use to most[/quote]
Well, if we can't attempt to run your code in order to test it, then it's definitely of little use.
Please write some VBA, test it, and report back here if the helix error persists.