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:
How to get insertionpoint of block when select attribute
« previous
next »
Print
Pages: [
1
] |
Go Down
Author
Topic: How to get insertionpoint of block when select attribute (Read 1472 times)
0 Members and 1 Guest are viewing this topic.
HasanCAD
Swamp Rat
Posts: 1421
How to get insertionpoint of block when select attribute
«
on:
March 27, 2017, 09:24:47 AM »
HI all
when select attribute (vlax-get objVL 'insertionpoint) gives the attribute insertionpoint
How to get the block insertionpoint?
This what I am using
Code - Auto/Visual Lisp:
[Select]
(
setq
obj
(
car
(
nentsel
"
\n
Select Origin attribute/Text : "
)
)
)
(
setq
objVL
(
vlax
-
ename
->
vla-object
obj
)
)
(
setq
objVL
-
Strng
(
vlax-get
objVL 'textstring
)
)
(
setq
objVL
-
inspnt
(
vlax-get
objVL 'insertionpoint
)
)
Logged
Sorry for my English.
Donate to Theswamp
www.sergiwa.com
Grrr1337
Swamp Rat
Posts: 812
WWW
Re: How to get insertionpoint of block when select attribute
«
Reply #1 on:
March 27, 2017, 09:36:32 AM »
Using activex, probably like this:
Code - Auto/Visual Lisp:
[Select]
(
and
(
setq
att
(
car
(
nentsel
"
\n
Select attribute: "
)
)
)
(
=
"ATTRIB"
(
cdr
(
assoc
0
(
entget
att
)
)
)
)
(
setq
attobj
(
vlax
-
ename
->
vla-object
att
)
)
(
setq
blkobj
(
vla-ObjectIdToObject
(
vla-get-ActiveDocument
(
vlax-get-acad-object
)
)
(
vla-get-OwnerID
attobj
)
)
)
(
setq
attpt
(
vlax-get
attobj 'InsertionPoint
)
)
(
setq
blkpt
(
vlax-get
blkobj 'InsertionPoint
)
)
)
; and
Logged
(apply ''((a b c)(a b c))
'(
(( f L ) (apply 'strcat (f L)))
(( L ) (if L (cons (chr (car L)) (f (cdr L)))))
(72 101 108 108 111 32 87 111 114 108 100)
)
)
vevo.bg
Pepe
Newt
Posts: 87
Re: How to get insertionpoint of block when select attribute
«
Reply #2 on:
March 27, 2017, 09:50:38 AM »
Just for comparing with plain Autolisp...
Code - Auto/Visual Lisp:
[Select]
(
and
(
setq
att
(
car
(
nentsel
"
\n
Select attribute: "
)
)
)
(
=
"ATTRIB"
(
cdr
(
assoc
0
(
entget
att
)
)
)
)
(
setq
attobj
(
vlax
-
ename
->
vla-object
att
)
)
(
setq
blkobj
(
cdr
(
assoc
330
(
entget
att
)
)
)
)
(
setq
attpt
(
vlax-get
attobj 'InsertionPoint
)
)
(
setq
blkpt
(
cdr
(
assoc
10
(
entget
blkobj
)
)
)
)
)
; and
Regards.
Logged
HasanCAD
Swamp Rat
Posts: 1421
Re: How to get insertionpoint of block when select attribute
«
Reply #3 on:
March 28, 2017, 01:47:42 AM »
Thanks Grrr1337
Thanks Pepe
both solutions are working perfect.
Logged
Sorry for my English.
Donate to Theswamp
www.sergiwa.com
Print
Pages: [
1
] |
Go Up
« previous
next »
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
How to get insertionpoint of block when select attribute