vla-rotate Viewport not working

vla-rotate Viewport not working

andkal
Collaborator Collaborator
881 Views
5 Replies
Message 1 of 6

vla-rotate Viewport not working

andkal
Collaborator
Collaborator

Does anybody know why vla-rotate doesnt work with Viewport objects (in paperspace)?

 

(defun c:test ( / obj1 cntrPT  )
    (setq obj1 (vlax-ename->vla-object (car (entsel) ) ))
    (setq cntrPT (vla-get-center obj1) )
    (vla-rotate obj1 cntrPT (/ pi 2) )  ;90°
);defun)

 

 


• www.autolisps.blogspot.com - Productivity plugins for Autocad and Autocad MEP
• Autodesk AppStore
0 Likes
882 Views
5 Replies
Replies (5)
Message 2 of 6

andkal
Collaborator
Collaborator

I guess I have to rotate the clipping object or object the viewport refers to under 330, 340 or 360 group code (depending on if it is clipped or not)


• www.autolisps.blogspot.com - Productivity plugins for Autocad and Autocad MEP
• Autodesk AppStore
0 Likes
Message 3 of 6

dlanorh
Advisor
Advisor

vla-rotate doesn't work because a viewport doesn't have a rotate method.

 

If you want to find out the properties and method of an object you can use this.

 

(defun c:pam () (vlax-dump-object (vlax-ename->vla-object (car (entsel "\nSelect Object for Properties and Methods"))) T))

 

 

I am not one of the robots you're looking for

0 Likes
Message 4 of 6

andkal
Collaborator
Collaborator

When I vlax-dump the viewport autocad displays in textscreen that Rotate method is supported.

 

; IAcadPViewport: IAcadPViewport Interface
; Property values:
;   Application (RO) = #<VLA-OBJECT IAcadApplication 00007ff7bb8870d8>
;   ArcSmoothness = 1000
;   Center = (444.498 116.185 0.0)
;   Clipped (RO) = 0
;   CustomScale = 0.00753387
;   Direction = (0.0 0.0 1.0)
;   DisplayLocked = 0
;   Document (RO) = #<VLA-OBJECT IAcadDocument 00000046cbccb548>
;   EntityTransparency = "ByLayer"
;   GridOn = -1
;   Handle (RO) = "29299EC4"
;   HasExtensionDictionary (RO) = -1
;   HasSheetView (RO) = 0
;   Height = 72.1666
;   Hyperlinks (RO) = #<VLA-OBJECT IAcadHyperlinks 00000046bdde0d98>
;   LabelBlockId = 0
;   Layer = "_XREF_ARCH_3D"
;   LayerPropertyOverrides (RO) = 0
;   LensLength = 50.0
;   Linetype = "ByLayer"
;   LinetypeScale = 1.0
;   Lineweight = -1
;   Material = "ByLayer"
;   ModelView = nil
;   ObjectID (RO) = 64
;   ObjectName (RO) = "AcDbViewport"
;   OwnerID (RO) = 44
;   PlotStyleName = "ByLayer"
;   ShadePlot = 0
;   SheetView = nil
;   SnapBasePoint = (0.0 0.0)
;   SnapOn = 0
;   SnapRotationAngle = 0.0
;   StandardScale = 1
;   StandardScale2 = 1
;   Target = (22011.0 49025.8 -1692.41)
;   TrueColor = #<VLA-OBJECT IAcadAcCmColor 00000046bdde0010>
;   TwistAngle = 0.0
;   UCSIconAtOrigin = 0
;   UCSIconOn = -1
;   UCSPerViewport = -1
;   ViewportOn = -1
;   Visible = -1
;   VisualStyle = 1
;   Width = 67.3134
; Methods supported:
;   ArrayPolar (3)
;   ArrayRectangular (6)
;   Copy ()
;   Delete ()
;   Display (1)
;   GetBoundingBox (2)
;   GetExtensionDictionary ()
;   GetGridSpacing (2)
;   GetSnapSpacing (2)
;   GetXData (3)
;   Highlight (1)
;   IntersectWith (2)
;   Mirror (2)
;   Mirror3D (3)
;   Move (2)
;   Rotate (2)
;   Rotate3D (3)
;   ScaleEntity (2)
;   SetGridSpacing (2)
;   SetSnapSpacing (2)
;   SetXData (2)
;   SyncModelView ()
;   TransformBy (1)
;   Update ()

 


• www.autolisps.blogspot.com - Productivity plugins for Autocad and Autocad MEP
• Autodesk AppStore
0 Likes
Message 5 of 6

andkal
Collaborator
Collaborator

Well, when I try to rotate clipped vievport object (without its boundaries selected) the view inside is rotates, but boundaries stay the same. When I rotate viewport that is not clipped, the view and the boundaries rotate.


• www.autolisps.blogspot.com - Productivity plugins for Autocad and Autocad MEP
• Autodesk AppStore
0 Likes
Message 6 of 6

dlanorh
Advisor
Advisor

Apologies I was looking at Viewport not PViewport. Have you checked your VPROTATEASSOC system variable.

I am not one of the robots you're looking for

0 Likes