Moldflow Insight Forum
Welcome to Autodesk’s Moldflow Insight Forums. Share your knowledge, ask questions, and explore popular Moldflow Insight topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

api macro to create xy-plot with node id

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
fukushige
1111 Views, 2 Replies

api macro to create xy-plot with node id

Hi, all

 

I'm troubling with the subjected api macro.

I want to create a XY-plot with known node ID.

Can anybody advise me which part is incorrect?

 

============================================================================

SetLocale("en-us")
Set Synergy = CreateObject("synergy.Synergy")
Synergy.SetUnits "Metric"
Set PlotManager = Synergy.PlotManager()
Set Plot = PlotManager.CreatePlotByDsID(1180, True)
Plot.SetXYPlotShowLegend True
Set Viewer = Synergy.Viewer()
Viewer.ShowPlot Plot
Set PlotManager = Synergy.PlotManager()
Set Plot = Viewer.ActivePlot()
Set Plot = EntList.SelectFromString "N20258"
Plot.SaveXYPlotCurveData "%MY_DOCUMENTS%\My ASMI 2013 Projects\test\output.txt"
Set PlotManager = Synergy.PlotManager()
Set Plot = PlotManager.FindPlotByName2("Pressure:XY Plot", "Pressure")
Set Viewer = Synergy.Viewer()
Viewer.HidePlot Plot

============================================================================

 

Best Regards,

2 REPLIES 2
Message 2 of 3
nordhb
in reply to: fukushige

Hi,
please, see below.

Regards,
Berndt

'==============================================================
SetLocale("en-us")
Set Synergy = CreateObject("synergy.Synergy")
Synergy.SetUnits "Metric"
Set StudyDoc = Synergy.StudyDoc()
Set EntList = StudyDoc.CreateEntityList() '* create an empty entity list
Set PlotManager = Synergy.PlotManager()
Set Plot = PlotManager.CreatePlotByDsID(1180, True)
Plot.SetXYPlotShowLegend True
Set Viewer = Synergy.Viewer()
Set PlotManager = Synergy.PlotManager()
Set Plot = Viewer.ActivePlot()
Set PlotManager = Synergy.PlotManager()
Set Plot = PlotManager.FindPlotByName2("Pressure:XY Plot", "Pressure")
Set Viewer = Synergy.Viewer()
EntList.SelectFromString "N20258"  '* popoulate the entity list
Plot.AddXYPlotCurve(EntList)  '* plot the curve of entity
Viewer.ShowPlot Plot
'==============================================================



Berndt Nordh
Message 3 of 3
fukushige
in reply to: fukushige

Dear Berndt-san

 

Thank you for your help!

It worked well.

 

Best Regards,

Shige

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report