Joined: Aug 13, 2015
Post Count: 1
Status:
Offline
How to get PlanComponent from Plug-in ?
Dear SweetHome community,
I'm trying to extract home plan top view into PNG files but knowing what is the scale. So knowing that for instance 1cm is 1px etc. I searched API and found that I could try somehow got to my aim through SVG extract. So I could extract SVG in plug-in and then try to convert to PNG file knowing rooms dimensions etc. BUT, to get SVN extract I have to get PlanComponent object first and according to JavaDoc it is only returned from MultipleLevelsPlanPanel.createPlanComponent method. Which doesn't look like the right one to use once the view is already created. Could you please help me and advice how may I export SVG file from inside the plug-in ?
France
Joined: Nov 7, 2005
Post Count: 9420
Status:
Offline
Re: How to get PlanComponent from Plug-in ?
You can access to MultipleLevelsPlanPanel instance with:
getHomeController().getPlanController().getView()
but this won't help you because there's no way to export to SVG from this component. I would suggest to create a PlanComponent instance and call exportToSVG or getClipboardImage on it like actual implementation of the matching menu.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator