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

RE: CreateTextElement1 Issue

$
0
0
No, it's not that.

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

RE: Procedure to search the value from the Excel in a Microstation files

$
0
0
Yeah, I need an Excel macro That will call MicroStation.

Any suggestions?


Regards, M k

RE: Procedure to search the value from the Excel in a Microstation files

$
0
0

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:

  1. Connect / start MicroStation from Excel VBA
  2. Open a design file
  3. Use ScanElementCriteria and ElementEnumerator to search for required data.

With regards,

  Jan

RE: CreateTextElement1 Issue

$
0
0
Could you zip and post a simplified (least steps to reproduce with exiting logging) copy of your source code module and "clean" solution for us to review and test with? Although the solution provides the major version of Visual Studio you use, please also provide us with the full version number and edition (Community, Professional, Team, etc.) since that may become relevant.

Thank you,
Bob

CreateTextElement1 Issue

$
0
0

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:
  • Point3d tipoDePlanoPoint = Microstation.App.Point3dFromXYZ...

[CE C#] Sizing problem of Toolbar by WPF

$
0
0

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:

  1. ResizeMode, WindowStyle cannot help fix the toolbox
  2. Toolbar_SizeChanged cannot help resize the toolbox
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;
        }
    }

RE: CreateTextElement1 Issue

$
0
0
Hi, I'm going to continue the thread started by my co-worker Ángela Alonso.

I will try to issolate the code, but it's a lot of work becouse it's a .dll who is used by other .dll that contains the main programm.

[V8i MicroStationAPI] Facetting Anomaly

$
0
0

[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?


RE: CreateTextElement1 Issue

$
0
0

(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:

  • Create two .fxc files (by programm), each one with some diferent elements:
  1. Get from .dgn some text elements
  2. Write same text elements at range boundaries
  3. For each text element, modify text properties (color, text, justification,...)
  4. Write

I wil work with this simplified code, to try reproduce on it the error detected originally.

RE: CreateTextElement1 Issue

$
0
0

Is your Application In-Process or Out-of-Process?

[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]

  1. Why do you need to register your DLL?  Is it a COM server?
  2. What do you need a VBA app. to run the application?
  3. If you're creating a .NET application, are you building an AddIn in-process app. (i.e. a DLL) or a stand-alone app. (i.e. an EXE)?

FXC File Type

[quote user="Jairo Martínez Fernández"]Create two .fxc files[/quote]

What is an .fxc file?

RE: Procedure to search the value from the Excel in a Microstation files

$
0
0

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

RE: Procedure to search the value from the Excel in a Microstation files

$
0
0

[quote user="M k"]My MicroStation VBA knowledge is very basic[/quote]

Then I suggest that you break your project into manageable pieces...

  1. Figure out how to search for text in MicroStation using VBA
  2. How to use VBA in one app. from another app. (e.g. Use Excel VBA to control MicroStation)
  3. Write Excel VBA to send text from a cell to your MicroStation search code

To help with the first task, read this article about Text Search & Replace for MicroStation.

RE: [V8i C++] Introvert Torus has Zero Volume

$
0
0
The red sphere is a circle revolved about itself (self-intersects). The V8i measure code isn't prepared for this, MicroStation Connect is more tolerant.

[V8i C++] Introvert Torus has Zero Volume

$
0
0

[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.

Helix method generates inconsistent B-Splines

$
0
0
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?



RE: [V8i MicroStationAPI] Facetting Anomaly

$
0
0
This is a scaled extrusion (either the x or y scale was 0, with the other scale .5). What do you mean by don't form triangles...I can certainly see getting degenerate triangles from the top profile (which is a degenerate shape (0 width).

RE: Helix method generates inconsistent B-Splines

$
0
0

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

RE: [V8i MicroStationAPI] Facetting Anomaly

$
0
0

[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

RE: [V8i MicroStationAPI] Facetting Anomaly

$
0
0

[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?

RE: Helix method generates inconsistent B-Splines

$
0
0

[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.

Viewing all 7260 articles
Browse latest View live


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