fastest way to create layout and viewport

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
In my code I need to make a hundreds of layouts.
Right now I'm using next method to do this.
1. make a copy of layout example:
(vl-cmdf "_.layout" "copy" laytocopy cur-layout-name)
2. activate new layout:
(vla-put-activelayout acdoc (vla-item vla-layouts cur-layout-name))
3. make new vieport:
(vl-cmdf "_.mview" "_NONE" p1 "_NONE" p2)
(setq vp (vlax-ename->vla-object (entlast)))
(vla-Display vp :vlax-true)
4. set viewport properties:
(vla-put-twistangle vp twist)
(vla-put-displaylocked vp :vlax-false)
(vla-put-mspace acdoc :vlax-true)
(vla-put-activepviewport acdoc vp)
(vlax-invoke acad 'ZoomCenter center 1.0)
(vla-put-CustomScale vp vp-scale)
(vla-put-mspace acdoc :vlax-false)
This is the method which I'm using, but sometimes it is too slow...
Is there any faster way to do this?
Thank you for answers,
dicra