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

change visibility dynamic blocks from command line

  • Thread starter Thread starter gabry_one
  • Start date Start date

gabry_one

Guest
Good evening,

as from object my question is very simple: can you change the visibility of dynamic blocks by inserting instructions from the command line?
as far as :frown sought: I managed to find only the command caprop valid only for properties in the "general" field that has any object

I thank anyone who can give me an answer
 
thanks tristan for the interest, I often have to insert on planimetries a number of points, sometimes even more than 100 each with its own id, symbol, and sometimes other information that I always have on excel files. In this regard I created a fairly simple macro vba excel, which from the table, generates a list of command lines like the following:
-Inset
bridge symbolism
100,100,0
1
0
punto001
value
valoreb

_ acmrselect
100,100,0

of course the list is repeated for all points in the table.. .
at this point I would only need the command to change the visibility status of the newly inserted block (and selected) so as to avoid the work of selecting the points to groups to assign them the right symbol!
I know that I could solve using separate blocks, but then during the revision of the table I would no longer have the possibility to change to the flight the symbolism of a point

I unfortunately with lisp I don't even know where to put my hands, if someone could find a solution I would be very grateful! !
 
the purpose of dynamic blocks is this: to be able to change them without resorting to other blocks and therefore use more or less long lists like that of visibility.
I wonder, why create an ad hoc command when I still have to act on a list, which cannot be on the autocad prompt?
 
I wonder, why create an ad hoc command when I still have to act on a list, which cannot be on the autocad prompt?
I am not very clear about the question, but the problem that I ask myself is as follows:phase 1 - data entryI realize the table by inserting a number of blocks with attribute. the original data are found on excel so it is easy to insert all the blocks in a single barrel from command line as reported some posts above
would not be a problem to use different blocks for different symbols if it were not for phase 2phase 2 - data reviewin the revision phase it happens to want to "force" the original data and change the symbolism of some block, at this point if I had not used a dynamic block in the previous phase, I would find myself to have to replace the existing block having to also manually insert the data of that block!

are also welcome alternative solutions of course!
 
You're right, so many people tell me I'm bad. .
I said that if you insert all the blocks in one shot, you will always be forced to change the symbolism of the blocks manually and this you cannot do it from the command line but only by clicking on the symbol of visibility of the block itself.
alternative, with the right lisp, could be to replace the block with another, recovering the data of the first, all with just one click. Here too, however, I can't do it as a command line.
 
with the right lisp, it could be to replace the block with another, recovering the data of the first, all with just one click.
Here, this would be a great solution to my problem, sure to do a lisp command I don't know where to start :frown:... do you know any quick guide for the lisp?
 
Hello everyone, a few months after the opening of the post I thought to post the solution I found on this same site:"putdbprops.lsp' allows to assign not only visibility but also other dynamic "properties" directly from the command line :finger:
and since there are also attached the excel file that I produced and perfected for the multiple insertion of blocks that, starting from an id table and its coordinates, allows to place on a cad design with few steps hundreds of blocks with specific properties for each (attributes, visibility, color, scale, rotation)
Obviously to run the whole thing goes first loaded the file lisp, which I recommend to insert into the start group. in addition being a somewhat forced procedure for autocad there would be a whole series of tricks to take, so if someone wanted to try and have difficulty I will be happy to help him!
 

Attachments

Hi, I tried your procedure but I made a mistake.

" command: putdbprops
; error: too few arguments
command: putdbprops; error: too few arguments "

Do you know why? tested on 2007 and 2014 aul.
Thank you.
 
Hi, I tried your procedure but I made a mistake.

" command: putdbprops
; error: too few arguments
command: putdbprops; error: too few arguments "

Do you know why? tested on 2007 and 2014 aul.
Thank you.
send me the dwg file with the block you used and the excel file as you compiled it, and let's see.
 
First of all thank you for the answer. I didn't think I could get a 2012 discussion back.
I don't know the language so much. In reality I would like to change the visibility of a dynamic block already inserted.
the practical case wants that in a topographic file there are many blocks (point type with 3 descriptive attributes and one visibility, called "vert") and my starting base reports on different layers the verts with a specific attribute (the shutters are on the layer "chiusini" etc.). now I have to "manually" isolate each layer, select the content and properties attribute to it: the specific field attribute of description and the specific aspect of visibility. as they are many types the thing is a little boring, but I think simple to automate.
Thank you for your valuable help.
 
Excuse me but, without drawing under my eyes, is not yet completely clear to me the problem, the blocks have already been placed and are only updated the attributes? Are the blocks already on the right layer?
However I do not program with lisp, I only created a macro excel in vba which starting from an information table (every line is related to information of a block: location, color, visibility etc.) generates a list of text lines that will be glued in the "command row" window of autocad. so in autocad are created all the blocks listed in the excel table with its properties.
with this system you cannot change blocks already inserted, as I seem to understand for your case. but it could be simple to extract the information of existing blocks with the "data extract" command, delete the blocks and reinsert them with my system by integrating in the table the missing information.
My system is very weak because there is no interaction between the lines that I create and the questions that autocad poses line after line, so the lines that fit must match perfectly. Sometimes between different versions of autocad the questions for the insertion of the blocks change and over time I had to adapt the macro to list the various commands in the right order. for this in the meantime I asked you to provide me with the excel file compiled by you along with the dwg file.
 
in fact I start from a file with inside already the blocks inserted and I was looking for a lisp command that changed the visibility parameter and the attribute description of dynamic blocks
 

Attachments

in fact I start from a file with inside already the blocks inserted and I was looking for a lisp command that changed the visibility parameter and the attribute description of dynamic blocks
Hi, I'm praying that I couldn't miss much time and so I had to adapt with what I had: my excel table provided the insertion of blocks with only 2 attributes, which fortunately provide 3 lines of text each, so I had to change your "vert" block the way it had a single multiline attribute. I said this I also modified my table so that it could change as well as the visibility of the block also the membership layer. and it worked! pasting the command lines in autocad were generated all the blocks each on the indicated layer.
modus operandi:
I extracted all information from your blocks (see "data extract from blocks.txt") with the "data extract" command of autocad then deleted them.
on notepad I replaced points with commas (otherwise excel makes casino) and reset txt data on temporary file "data extraction from blocks.xlsx"
I glued the individual data columns within the table "Insert blocks with layer.xlsm" respecting column header
I have correctly selected the parameters at the top right: block with 1 multiline attribute, "yes" visibility parameter, uniform scale "yes" (p.s. I set the uniform scale on your block).
remains to be compiled for each line (every line is a block!) the description you had provided for in the 3rd row, which I assigned an example value "descr_001" and assign the right parameter of visibility (I compiled the first 20/30 blocks)
click on processing data and an output sheet is generated with all command lines (e.g. lines are already in memory, just paste them)
ctrl+v on the autocad command line and see that in seconds hundreds of blocks are created with all the compiled information.
notes:
1. remember that to make all the ride work you must necessarily load the putdbprops.lsp that I entered in the annex (it is not mine, I found it on the internet)
2. when it seems to have finished entering blocks, autocad freezes, and remains "freeze" even for 40/50 seconds, but then it always recovers!
3. avoid inserting spaces in descriptions, rather use "_"

I hope I helped you. Say hi!
 

Attachments

I'm looking at the file that the procedure has generated but unfortunately in the blocks still seems to me that there is no automatism to vary the visibility parameter or wrong?
 
provided that I had not written in the previous place that the attached dwg file has the blocks inserted with my procedure.
so predicted, this is a file extract generated by the macro (relative to point 102):
-Inset
(PHP 4 = 4.1.0)
1510985.554,5041253.332


102
11.05
(PHP 4 = 4.1.0)

(putdbprops (car (entsel "\ nselect dynamic block:") '(("visibility." "chiu caditoia")))
ultimo
selez
ultimo

caprop
layer
289 chiu caditoia
allariga "(putdbprops (car (entsel "\nselect dynamic block:)))"(("("visibility" . "Each caditoia"))" is set the visibility of the block on the caditoia symbol, and in fact on the file.dwg previously allegto the block n. 102 is set on caditoia.
Why do you say you don't see automatism? Or maybe I didn't understand what you needed?
 
Maybe it's better if you miss us a few days to do some tests, I never want to ask you some trivial questions by just losing time and patience. We'll talk to you in a few days if you still have time to devote. Thank you.
 

Forum statistics

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

Members online

No members online now.
Back
Top