Skip navigation
Currently Being Moderated

How SetGeometricBounds of a Rectangle

May 21, 2012 9:58 PM

I am creating a rectangle using vc++.

There is a problem to use the SetGeometricBounds() function in vc++. It take one argument but there is requirement of four argument. But this function work welll in C#

InDesign.Rectangle rectangle = page.Rectangles.Add(document.Layers.FirstItem(), idLocationOptions.idUnknown, page);

rectangle.GeometricBounds = new[] { 20, 30, 120, 130 };

My Steps are

INDESIGN::Rectangle rectangle = rectangles.Add(covOptional,(long)1433299822,covOptional);

rectangle.SetGeometricBounds(const VARIANT &newValue);

SetGeometricBounds() function take one argument const VARIANT &newValue but parameter should be Array of Measurement Unit (Number or String). When i pass an array of these measurement unit then it also give error.

 

Thanks

 
Replies
  • Currently Being Moderated
    May 22, 2012 3:05 PM   in reply to Bill joy

    You apparently use C++ with the "high level" scripting API, while this forum is traditionally the place for "low level" plugins. For scripting API questions probably your issues are better answered in the scripting forum even though I think you'll earn some stares when you mention your choice of C++. Why would you jump thru hoops of that more demanding language just to end up at the same thing that you'd get with a better supported scripting language?

     

    Anyway, if you're in doubt what to feed into a setter method, just use the matching getter and inspect the result. It is again beyond me though how to use reflection of managed code in C++. I'd try just the equivalent to an array of 4 doubles if that differs from your quoted code "new [] {...}" above, but again I don't know how to produce that. Maybe add a "double" keyword at the appropriate place?

     

    I think there are also some tools to disassemble your working C# code so you'd learn what magic conversions are used under the hood there.

     

    Dirk

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points