Error message
Hello,
recording a macro caused an error : "non-static method requires a target".
what I did was just setting a polygon measurement area in an image.
What went wrong? Any idea?
Regards
0
Best Answer
-
Hi Thomas, It looks a locale problem, you have to replace commas by dots in the numbers:x .Points.Add(New System.Drawing.PointF(112.5667F,72.94762F)).Points.Add(New System.Drawing.PointF(45.10477F,45.10477F))For you testing you may temporary change decimal separator in Window's settings from comma to dot. It supposed to be fixed in 9.0.3 patch, but I will double check.Yuri0
Answers
-
Hi Thomas,It's difficult to say what the problem is without looking at the macro. The error can be caused by previously recorded macros in that scrips. When you have the error the tooltip tells you the line number of the error.You ca try to create a new project and record the same macro to see if it works. If it will still fail, please post the macro and the version of Premier your are using.Regards,Yuri0
-
Thank you for your comment.Here is an example...setting a "measurement circle" into an image ...in a completely new project - the "x" is marking the problematic line (IP Premier 9.1 evaluation version) :Imports MediaCy.Addins.MeasurementsPublic Module Module1Public Function NewMacro() As SimpleScriptNewMacro = New SimpleScriptDim image1, meas1With Application.DocumentCommands.ActiveImage(NewMacro).Run(image1)End WithWith Measure.MeasurementsCommands.Add(NewMacro).MeasurementType = McMeasurements.enumMMSTypes.mmtsCircle.Points = New System.Collections.Generic.List(Of System.Drawing.PointF)x .Points.Add(New System.Drawing.PointF(112,5667F,72,94762F)).Points.Add(New System.Drawing.PointF(45,10477F,45,10477F)).FeatureName = "C1".SnapFeature = False.Run(image1, meas1)End WithEnd FunctionEnd Module0
-
Hi Thomas,I just checked and can confirm that recording coordinates with European locale is working properly in the latest version. If you are prompted to install a patch at startup, please do that. You can check the version of the application in the About dialog box.Yuri0
-
Hello Yuri,indeed, this was the reason.Thanks for the information....especially because it is Sunday.Thomas0
Categories
- All Categories
- 961 Image-Pro v9 and higher
- 9 Image-Pro FAQs
- 18 Image-Pro Download & Install
- 448 Image-Pro General Discussions
- 486 Image-Pro Automation (Macros, Apps, Reports)
- 20 AutoQuant Deconvolution
- 2 AutoQuant Download & Install
- 18 AutoQuant General Discussions
- 195 Image-Pro Plus v7 and lower
- 3 Image-Pro Plus Download & Install
- 106 Image-Pro Plus General Discussions
- 86 Image-Pro Plus Automation with Macros
- 19 Legacy Products
- 16 Image-Pro Premier 3D General Discussions
- 26 Image-Pro Insight General Discussions