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:
ObjectDBX and attributes: Doesn't work?
« previous
next »
Print
Pages:
1
[
2
]
All
|
Go Down
Author
Topic: ObjectDBX and attributes: Doesn't work? (Read 8279 times)
0 Members and 1 Guest are viewing this topic.
codered8x
Guest
Re: ObjectDBX and attributes: Doesn't work?
«
Reply #15 on:
February 29, 2012, 05:41:03 AM »
when i get attributes (in block) from unopen drawing, use objectdbx , appear this error :
"error: ActiveX Server returned the error: unknown name: GETATTRIBUTES" ?
Logged
Lee Mac
Seagull
Posts: 12915
London, England
WWW
Re: ObjectDBX and attributes: Doesn't work?
«
Reply #16 on:
February 29, 2012, 06:21:28 AM »
On what object are you attempting to evaluate the method?
Logged
Lee Mac Programming
•
Twitter
•
Exchange App Store
codered8x
Guest
Re: ObjectDBX and attributes: Doesn't work?
«
Reply #17 on:
February 29, 2012, 10:28:16 AM »
This time I encountered this error message: " ActiveX Server returned the error: unknown name:
HasAttributes. "
Code - Auto/Visual Lisp:
[Select]
(
defun
c:getatt
(
)
(
vl-load-com
)
(
setq
file
(
getfiled
"Select DWG file"
""
"dwg"
4
)
prid
(
strcat
"objectDBX.Axdbdocument."
(
substr
(
getvar
'acadver
)
1
2
)
)
dbxdoc
(
vla-getinterfaceobject
(
vlax-get-acad-object
)
prid
)
)
(
vlax-invoke-method
dbxdoc '
open
file
)
(
vlax-for
blk
(
vla-get-blocks
dbxdoc
)
(
if
(
and
(
/=
(
substr
(
vla-get-name
blk
)
1
1
)
"*"
)
(
=
:vlax-true
(
vla-get-hasattributes
blk
)
)
)
(
setq
att
(
vlax-invoke
blk 'getattributes
)
attlst
(
cons
(
vla-get-textstring
(
nth
0
att
)
)
attlst
)
)
)
)
(
reverse
attlst
)
(
vlax-release-object
dbxdoc
)
)
Can you tell me the cause and fix it.
Logged
Lee Mac
Seagull
Posts: 12915
London, England
WWW
Re: ObjectDBX and attributes: Doesn't work?
«
Reply #18 on:
February 29, 2012, 11:04:58 AM »
You are operating on a Block Definition object, not a Block Reference - study Example 4 of my ObjectDBX Wrapper program:
http://www.theswamp.org/index.php?topic=31827.0
In fact, this whole thread is discussing the same thing.
«
Last Edit: February 29, 2012, 11:08:30 AM by Lee Mac
»
Logged
Lee Mac Programming
•
Twitter
•
Exchange App Store
codered8x
Guest
Re: ObjectDBX and attributes: Doesn't work?
«
Reply #19 on:
February 29, 2012, 10:21:15 PM »
Many thanks, Lee ! That topic help me so much. Cause is I haven't understood relating between Block and Layout.
Logged
Lee Mac
Seagull
Posts: 12915
London, England
WWW
Re: ObjectDBX and attributes: Doesn't work?
«
Reply #20 on:
March 01, 2012, 07:48:30 AM »
You're welcome
To help with your understanding, I would suggest that you research the different between a Block Definition Object (BLOCK) and a Block Reference Object (INSERT). There are many explanations to be found on this forum - I must've explained it at least three times
Logged
Lee Mac Programming
•
Twitter
•
Exchange App Store
Print
Pages:
1
[
2
]
All
|
Go Up
« previous
next »
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
ObjectDBX and attributes: Doesn't work?