scr for copying a block to multiple points at once
Solved! Go to Solution.
Solved by cadffm. Go to Solution.
Hi,
you got so many help, stop asking for whole solution and start to understand &learning.
For example
Instead of circle or cecolor, start
with a blank scr file with only
-INSERT<enter>
Run the script and look what autocad ask for [F2!], it is the blockname,
add your blockname to your scr followed by enter.
-INSERT
MYBLOCK
followed by enter and test it again.
Sebastian
can we copy a block to multiple points at once using scr
without inserting .is it possible or not
If you started making scripts, you would know!
Yes, you can do that. Why not
But the problem is: You are very limited for object selection in script,
except you using lisp, but then you can write all what you want in lisp and no need
to use the limited script way.
You are posting in AutoCAD Forum, so if you have AutoCAD you can use Lispfunctions and Expresstools,
in this case it shouldn't be a problem, but I wouldn't use a Script.
>"without inserting .is it possible or not"
Inserting or copy or any other AutoCAD command, the script-technic is the same.
Stop asking, start doing 😉
If you are able to select your Blockreference, you can copy it.
Start with script writing and if you have a problem, ask for it (by description of goal and your current *.scr file [as .txt file attachment] )
How to: The same way I wrote before.
Take a blank *.scr file and start with
_copy<enter>
load the script and read what AutoCAD ask for..
follow the
command syntax and expand your script step by step, until you defined the whole workflow .
;;sample to copy THE LAST object 3x to 20,0 -> 20,20 -> 0,20
osnapcoord 1
_copy
_last
_multiple
0,0
20,0
20,20
0,20
_exit
Sebastian
I have a situation where I have multiple points that need to be replaced by a block with attributes. I have never done anything like this before. I was able to find a lisp text created by somoen online, from which I ceated my lisp file but it seems like the attributes from the block are not visible. Selecting the block to see its properties, the "Attributes" is not there, but if I try to edit block in place or Block editor, the "Attributes" default is displayed and visible to edit its properties. Attached is the lisp file. let me know what I am doing wrong.
@kamalj schrieb:
The Thread is about creating a *.SCR file for copying a block to multiple points at once..
So Please: Start your own thread if it doesn't match 100% (and in this case, it matchs 0%)
But okay, Point->Insert is given and I took a look
The pt2block isn't perfect and one of the tiny mistakes is: It creates an insert without attributes (attributes are attached on inserts),
even if the current block definition contains attributdefinitions(this is what you see in bedit or refedit).
Solution:
Run a ATTSYNC[F1] for this Block!
And for the feature, edit your code from
{look at the last lines of code in your .lsp}
edited version:
); end progn
); end if valid input?
(princ)
)
to
(command "_.ATTSYNC" "_name" bname)
); end progn
); end if valid input?
(princ)
)
HTH
Sebastian
That worked out perfectly. Thank you for the that 1 line code that I added. It clearly will save me alot of hours for this floor level. I have another 6 floors with more than 1000 points. Thank you once again.
Can't find what you're looking for? Ask the community or share your knowledge.