Hello
Referring to my post here:
communities.bentley.com/.../view-independent-fill
regarding the permanent filling of surfaces, I come to the programmers forum and ask for help.Jon has already posted a few variables, which let me hoping that my intention should be possible.
I want to fill areas with a permanent fill, but I do not know how that works exactly.The suggested MDL and VBA solution ...., is that a macro to set up the basic settings for the fill to "permanent", so that all new created filled shapes will automatically be filled permanently?Or does it only work in a way to create elements (filled shapes) also with the macro?Or is it possible to select a non permanent filled shape and running a macro to set it to permanent fill?
I really have no idea how this should work :(
I would be very glad if someone could explain to me how permanent surfaces can be generated.
ThanksRegardsRaphael
Hi Raphael,
as Brien wrote in the discussion you mentioned, it can be done by MDL (only), because it's internal setting not accessible from GUI. The problem is it's not documented (probably used by Bentley only) and I am not aware of any discussion or information describing how permanentley filled element can be created.
Even in header files delivered with MicroStation SDK, only "standard" values (noe, opaque, outlined) are mentioned, so I guess it will require some extra knowledge or workflow.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
You can create elements that are always filled using the C++ api...
/*=================================================================================**//*** Provides methods for changing the area properties of an element.* Implemented by Element handlers that define a closed shape or region. * @remark Required library : DgnPlatform<ApiNumber>.lib i.e. DgnPlatform5.lib* @bsiclass+===============+===============+===============+===============+===============+======*/CLRPUBLIC struct EXPORT_VTABLE_ATTRIBUTE IAreaFillPropertiesEdit : public IAreaFillPropertiesQuery{/*---------------------------------------------------------------------------------**//*** Add solid fill to the supplied element.* @param[in] eeh The element to modify.* @param[in] fillColorP fill color, pass NULL for an opaque fill using the same color as the edge color.* @param[in] alwaysFilledP whether to honor the fill view attribute, pass NULL for per-view fill.* @return true if element was updated.* @bsimethod+---------------+---------------+---------------+---------------+---------------+------*/DGNPLATFORM_EXPORT bool AddSolidFill (EditElementHandleR eeh, UInt32* fillColorP = NULL, bool* alwaysFilledP = NULL);
Hi,
This is unfortunately too high for me :(I have read in some tutorials about VBA and MDL programming ..... but is like Chinese for me.
Unfortunately I will not be able to realize my idea without help.
If someone could help me with a concrete solution, that would be very nice and I very grateful.
ThanksRaphael
Unknown said:Unfortunately I will not be able to realize my idea without help.
The first step should be to specify what MicroStation version do you use. The solution proposed by Brien is for CONNECT Edition. Because it's a part of new CE API, it's not available in V8i (I was not able to find a similar funciton).
Regards,
Hi Jan,sorry, I mentioned only in the other post the used version.We use MS V8i SS3 and there is no change to connect foreseen at this time.Regards,Raphael
There's an unpublished mdl function in V8i that should work:
StatusInt mdlElement_setAlwaysFilled(MSElement* elmBufP, BoolInt alwaysFill);
Element must already have fill, returns ERROR if a solid or gradient fill isn't present...
HTH
Unknown said:We use MS V8i SS3 and there is no change to connect foreseen at this time.
In such case, as Brien wrote, you can use mdlElement_setAlwaysFilled funciton. If I understand it right, because the function was not published officially, it has not VBA wrapper (I did not find it in stdmdlbltin.dll), so you have to implement the functionality in MDL or in C#.
Technical explanation is MicroStation MDL functions are exported using cdecl calling convention, but VBA supports only stdcall when accessing functions from DLL (and it's the main role of VBA wrappers and the libraries like stdmdlbltin.dll etc.). C# support cdecl, so it can be used.
Hi,Now I have this famous book (Learning Microstation VBA by Jerry Winters) and do reading and trying VBA :))It is very interesting and it helps very quickly to get a first insight into VBA programming, to understanding the terms and structure of codes: Modules, Forms, Class Modules, Variables etc ...The first small exercise in this book, the programming of the "DrawTarget" procedure, could be solved and I could understand the lines of code.Generally the explanations are very good and understandable.Solving the exercises, with the step by step tutorials in this book is a nice thing.However, I must also realize at this time that programming my application without such help, remains unattainable for me.
I have no idea where to start and need more help.
Many ThanksRegardsRaphael
Yes would be great if Bentley could provide some example MDL/VBA tool which could do this. As still Cells in Cell Library preview doesn't show fill attribute(you can choose only between wireframe and smooth) this would be an option for administrators to create such cells with fill always on.
Unfortunately there's no simple way to achieve that using VBA. While Brien has revealed an unpublished MDL function that does the trick, there's no way to call that function from VBA (the MDL function wants a pointer to an MSElement and there's no conversion from VBA Element to MSElement).
MSElement
Element
In other words, the solution would be an MDL applet.
Regards, Jon Summers LA Solutions