Hi all
We've found a bug in mdlPattern_addAssociative (and in mdlPattern_addAssociative2 as well). If you use code like this:
PatternParams patPar; memset(&patPar, 0, sizeof(patPar)); patPar.modifiers |= PATMOD_SPACE1; patPar.modifiers |= PATMOD_ANGLE1; patPar.modifiers |= PATMOD_COLOR; patPar.space1 = 5000; patPar.angle1 = fc_pi / 4; patPar.color = 3; rc = mdlPattern_addAssociative(edPP, 0, 0, &patPar, NULL, NULL, PATTERN_HATCH, mdlModelRef_getActive());
the function returns SUCCESS, BUT at first glance it seems like no pattern have been added to the shape (edPP). But if you use the "Show Pattern Attributes" tool you will se that PA (pattern angle) is zero and PD (pattern distance) is zero as well.
In V8i SS3 this works just fine...
Regards, Evan
Hi EvanH,
I copied your code as-is and was able to place hatches successfully.
SHOW PATTERN reports correctly “Hatching: PA=45.0000,0.0000, PD=2.0000,0.0000”.
The only side issue I noticed was the call to mdlElmdscr_add (), which is meant for creating a clone of the original shape. This is not a problem, just an observation. The hatch was created on the cloned shape successfully.
Replacing it with mdlElmdscr_rewrite () created the hatch on the original shape successfully too.
Please let me know what I am missing. When you run your code, does it create a hatch at all? Are you trying to update an existing hatch?
Can you send me a DGN file containing a hatch created by your tool in MicroStation V8i Ss3?
Unknown said:I copied your code as-is and was able to place hatches successfully
In which version of MicroStation? This problem seems to be strongly related to version.
Regards, Jon Summers LA Solutions
Hi Sunand,
I'm VERY surprised that you can attach the pattern with the code listed. As Jon points out the problem is strongly related to version. Please check the code on the released version.
The reason for using mdlElmdscr_add instead of mdlElmdscr_rewrite is that the original shape might come from a reference file (when using my original application)
I've attached to .dgn files PatternTest_SS3.dgn and PatternTest_SS4.dgn showing the results when running the test in the two versions.
PatternTest_SS3.dgnPatternTest_SS4.dgn
Works for me too. This also explains why this occurred in ss2 while compiling with the ss3 SDK.
Was this fixed ever publicly released for MicroStation V8i? I still cannot extract the pattern modifiers correctly in SELECTSeries 10 (v8.11.09.908). Calling the function mdlPattern_extractAssociative2() always give me a pattern modifier of zero, even though I can read the actual patterning values (angle, cell name, spacing, etc) after calling the function. This makes it impossible to read a pattern element reliably from the SDK in SS4.
--Piers PorterAltiva Software
Hi Piers
Yes, it was fixed in v8.11.9.752, BUT in version 8.11.9.865 the bug was introduced again... Because of this, we got two versions of the application that works with patterning...