• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

read blocks and overwrite attributes

  • Thread starter Thread starter cata850
  • Start date Start date

cata850

Guest
Hello everyone!
I still need help from you! !
this time I should open a cad file and read a certain block and (take and overwrite) attributes... is it clear?? ?
 
Hello everyone!
I still need help from you! !
this time I should open a cad file and read a certain block and (take and overwrite) attributes... is it clear?? ?
Clearly it is clear, but if you give us some extra information it would be better, than blocking that attributes, maybe post the block or an example of what you need.
 
ok rereading I understand that I forgot the fundamental thing, everything has to be done in vb,
In practice I need this:
I have a block named "info" (the block I haven't created it yet I can do it as I want)
such block has 3 attributes, a1, a2, a3.
in a sheet cad there are a variable tot of these blocks, to me it would be necessary to take the value of the attribute a1,a2 and change the content of a3
 
ok rereading I understand that I forgot the fundamental thing, everything has to be done in vb,
In practice I need this:
I have a block named "info" (the block I haven't created it yet I can do it as I want)
such block has 3 attributes, a1, a2, a3.
in a sheet cad there are a variable tot of these blocks, to me it would be necessary to take the value of the attribute a1,a2 and change the content of a3
you can do it, as soon as you're ready to block or you have at least one example the place so you develop the thing...

It's not difficult, so I'm working so I don't put much on it.
 
you can do it, as soon as you're ready to block or you have at least one example the place so you develop the thing...

It's not difficult, so I'm working so I don't put much on it.
Sure when you have time, one thing, what do you mean when you place the block?? I'll explain, the structure of the block is what I mentioned before ,cmq I have no restrictions on how to create it, isn't that enough? ?
 
Sure when you have time, one thing, what do you mean when you place the block?? I'll explain, the structure of the block is what I mentioned before ,cmq I have no restrictions on how to create it, isn't that enough? ?
Yes, but when you tell me... take a1,a2 and change a3 you have to tell me how... a1+a2=a3 a1 & a2=a3 a3=pluto or duck... I mean what to do.. .
or do you want to read a1 and a2 and only then decide what to ski in a3?
 
I'll tell you everything.
the intent is this:
read the content of a1 and a2 save it in a db..
this for all blocks with the name "mybloc" and for the block with the name "mybloc2" of a certain collection. .
after which to associate the field: "page", of the database, to the a3 attribute of both blocks.. .
I understand that it is not a thing you do in 10 minutes but I just need to understand how to take the attributes of a block
 
I'll tell you everything.
the intent is this:
read the content of a1 and a2 save it in a db..
this for all blocks with the name "mybloc" and for the block with the name "mybloc2" of a certain collection. .
after which to associate the field: "page", of the database, to the a3 attribute of both blocks.. .
I understand that it is not a thing you do in 10 minutes but I just need to understand how to take the attributes of a block
save in an existing db?

Sincerely I'm not following you very much, and I don't understand if you have programming knowledge or want ready qlc. .

in money.. .

you have to make a selection to select the blocks and the fuintion is

set sset = thisdrawing.selectionsets.add("element")

where you must declare that

dim sset as acadselectionset
dim element as acadblockreference


declare the filter on the blocks

dim filtertype(1) as integer
dim filterdata(1) as variant


filtertype(0) = 0
filterdata(0) = "insert"
filtertype(1) = 2
filterdata(1) = "mybloc"


then perform the selection with the filter

, filtertype, filterdata


At this point you have an array with all the locks that are called "mybloc"

now you have to read attributes

dim array as variant

for each element in sset
array = element.getattributes
for i = lbound(array) to ubound(array)
array(s).tagstring law label attribute array(i). text string Act attribute value next i
next element

I would fix it, but the hiccup information you give me is really jagged.
 
no the db I have to create it, I thought with this structure(id,description_bl1,pagbl1,pin,description_bl2,pagbl2,pout)
on programming in general more or less I should not have big problems, although advice is always well accepted =), are more in trouble when I have to deal with the bookstores of the cad because I can not find information on the internet.. .
cmq Monday I try and let you know. .
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top