Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Login
Register
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
Not able to find vla-get-TwistAngle of selected Viewport
« previous
next »
Print
Pages: [
1
] |
Go Down
Author
Topic: Not able to find vla-get-TwistAngle of selected Viewport (Read 1350 times)
0 Members and 1 Guest are viewing this topic.
mailmaverick
Bull Frog
Posts: 493
Not able to find vla-get-TwistAngle of selected Viewport
«
on:
November 08, 2017, 07:39:06 AM »
Hi
I have a Viewport which is rotated and I want to find its angle of rotation. When I run the command :
(setq ang (vla-get-TwistAngle (vlax-ename->vla-object (car (entsel)))))
it gives error. Please help.
Logged
roy_043
Water Moccasin
Posts: 1895
BricsCAD 18
Re: Not able to find vla-get-TwistAngle of selected Viewport
«
Reply #1 on:
November 08, 2017, 08:00:45 AM »
Check if the entity is the VP and not the clipping boundary entity belonging to the VP.
Code - Auto/Visual Lisp:
[Select]
(
setq
elist
(
entget
ename
)
)
(
or
(
=
"VIEWPORT"
(
cdr
(
assoc
0
elist
)
)
)
(
and
(
setq
ename
(
cdadr
(
member
'
(
102
.
"{ACAD_REACTORS"
)
elist
)
)
)
(
setq
elist
(
entget
ename
)
)
(
=
"VIEWPORT"
(
cdr
(
assoc
0
elist
)
)
)
)
(
prompt
"
\n
Error: not a viewport "
)
)
«
Last Edit: November 08, 2017, 08:08:03 AM by roy_043
»
Logged
ronjonp
Needs a day job
Posts: 7529
Re: Not able to find vla-get-TwistAngle of selected Viewport
«
Reply #2 on:
November 08, 2017, 09:09:36 AM »
Another to return the ename:
Code - Auto/Visual Lisp:
[Select]
(
defun
_getvport
(
e
)
(
if
(
=
'ename
(
type
e
)
)
(
cond
(
(
=
"VIEWPORT"
(
cdr
(
assoc
0
(
entget
e
)
)
)
)
e
)
(
(
and
(
setq
e
(
cdr
(
assoc
330
(
entget
e
)
)
)
)
(
=
"VIEWPORT"
(
cdr
(
assoc
0
(
entget
e
)
)
)
)
)
e
)
)
)
)
;; Usage
(
if
(
setq
e
(
_getvport
(
car
(
entsel
)
)
)
)
(
setq
a
(
cdr
(
assoc
51
(
entget
e
)
)
)
)
)
Logged
Windows 11 x64 - AutoCAD /C3D 2023
Custom Build PC
Lee Mac
Seagull
Posts: 12913
London, England
WWW
Re: Not able to find vla-get-TwistAngle of selected Viewport
«
Reply #3 on:
November 08, 2017, 12:37:34 PM »
And another:
Code - Auto/Visual Lisp:
[Select]
(
defun
c:test
(
/
sel
)
(
if
(
setq
sel
(
ssget
"_+.:E:S"
'
(
(
0
.
"VIEWPORT"
)
)
)
)
(
cdr
(
assoc
51
(
entget
(
ssname
sel
0
)
)
)
)
)
)
Logged
Lee Mac Programming
•
Twitter
•
Exchange App Store
mailmaverick
Bull Frog
Posts: 493
Re: Not able to find vla-get-TwistAngle of selected Viewport
«
Reply #4 on:
November 08, 2017, 12:44:24 PM »
Thanks a lot. Problem Solved !!!
Logged
Print
Pages: [
1
] |
Go Up
« previous
next »
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
Not able to find vla-get-TwistAngle of selected Viewport