Author Topic: Changing twistView for All Layout  (Read 1826 times)

0 Members and 1 Guest are viewing this topic.

Andrea

  • Water Moccasin
  • Posts: 2372
Changing twistView for All Layout
« on: February 09, 2012, 11:40:27 AM »
Hi all,

I'm not able to change the twistview for all layout or a specific one when i'm in model space.

Code: [Select]
(defun MVrotate (MviewHAndle MVangle)
  (vla-put-TwistAngle
    (vlax-ename->vla-object (cdr (assoc 330 (entget (handent MviewHAndle)))))
    (- (read MVangle))
  )
)

Note: the Mview is in fact a closed polyline, that why I use 330 code.
The code seem to work great in PaperSpace.

any help will be appreciated thank you.

also,...this will increase the theswamp database. (see below)   :kewl:
Keep smile...

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Changing twistView for All Layout
« Reply #1 on: February 09, 2012, 11:50:00 AM »
TwistAngle is a property of a PViewport (= Paperspace Viewport) hence I doubt it will work in Model.

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Changing twistView for All Layout
« Reply #2 on: February 09, 2012, 12:04:43 PM »
for model space

Command: SETVAR Enter variable name or [?] <VIEWTWIST>:

VIEWTWIST = 56 (read only)
Be your Best


Michael Farrell
http://primeservicesglobal.com/

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Changing twistView for All Layout
« Reply #3 on: February 09, 2012, 12:15:58 PM »
There we go...

Code: [Select]
(vlax-for layouts
                (vla-get-layouts
                  (vla-get-activedocument
                    (vlax-get-acad-object)
                  )
                )
    (if (eq (vla-get-modeltype layouts) :vlax-false)
      (vlax-for n (vla-get-block layouts)
        (if (and
      (= (vla-get-objectname n) "AcDbViewport")
      (eq (vla-get-handle n) (cdr (assoc 5 (entget (cdr (assoc 330 (entget (handent MviewHAndle))))))))
    )
          (vla-put-TwistAngle n (- (read MVangle)))
        )
      )
    )
  )
« Last Edit: February 09, 2012, 01:09:26 PM by Andrea »
Keep smile...