Change Distance Command Line ony

Change Distance Command Line ony

lmnDCJSJ
Enthusiast Enthusiast
1,037 Views
8 Replies
Message 1 of 9

Change Distance Command Line ony

lmnDCJSJ
Enthusiast
Enthusiast

Hi

I have a setup, where i can insert a lot of objects, including dynamic blocks, but is there any way to change the parameters, using only keyboard (because of scripting)?

 

Eg i want to change the Distance parameter from the 1000 mm to 4320 mm.

 

I know i can grab the arrow, and drag it, but I dont want to use the mouse, because I have a setup, where all of the blocks are inserted in the correct place, and rotation, but I can figure out to chang the parameter, in my work file (not the one where the Dynamic block is made).

 

I hope it makes sense 🙂

0 Likes
Accepted solutions (1)
1,038 Views
8 Replies
Replies (8)
Message 2 of 9

j.palmeL29YX
Mentor
Mentor

Perhaps you can embed the attached LISP in your workflow (?).

 

 

Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 3 of 9

lmnDCJSJ
Enthusiast
Enthusiast

Hi Jürgen

 

Thanks for the lisp, but it does not suit my workflow, because it is depending on interaction, and to have the source file open (to drag it from Design Center).

 

It does the job, but I cant use it in my scripting workflow.

0 Likes
Message 4 of 9

j.palmeL29YX
Mentor
Mentor

@lmnDCJSJ wrote:


... it is depending on interaction, and to have the source file open (to drag it from Design Center).

 

 


Both I don't understand. Can you describe your workflow more detailed? Here I don't need neither interactions nor the Design Center to insert many (dynamic) blocks with different values at different places (including different insertion angles and scale factors if needed).

 

 

 

Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 5 of 9

lmnDCJSJ
Enthusiast
Enthusiast

My Workflow is very complex, but it is a lot of scripting-files, inserted in prdeterment places, but E.g. the length varies.

I have tried diffent methods, and you are correct on the lisp working, and it is working when i use the normal INSERT method, but when i use -INSERT command, I am not prompted with the options for the parameters.

 

I have been looking at the Lisp, and with my basic knowledge, it seems like it should work with the -INSERT command, but it does not.

 

I have tried to use INSERT in a empty drawing, and it works, but when i do the same thing, in a new empty drawing, using -INSERT i dont get the option.

0 Likes
Message 6 of 9

j.palmeL29YX
Mentor
Mentor
Accepted solution

An explanation how I understand your issue:

 

Assuming we create a new dwg-file.

In this file of course the LISP must be loaded. Note also the necessary values for some system variables (in my script the first comment lines as example).

Attached a Script file example (delete the .txt extension).

First you need in your current working file the block definitions which you want to use. For this demonstration I use a "library" file "Script_example.dwg" (also attached) which includes two (dynamic) block definitions "b1" and "b2".

The first lines of the script insert this library file. It brings the block definitions b1 and b2 with it. (Of course there are a lot of other ways to insert the needed block definitions, use a way of your choice).

In the next lines of the script I insert the blocks b1 and b2 at different places with different parameter values and different insertion angles.

I think this is this is pretty much what you want - and here it works.

([EDIT]: Which AutoCAD version do you use?)

 

 

HTH

 

 

If my reply solves your problem, click the "accept as solution" button. This can help others find solutions faster.

 

 

 

Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 7 of 9

lmnDCJSJ
Enthusiast
Enthusiast

I used the script, and i does 100% what i want it to do, so I did a little digging into, why my does not, but the problem for me, is in the block/dynamic block.

 

But now i have all i need to get it to work, i just have to ajust my files.

 

Thanks alot 🙂

0 Likes
Message 8 of 9

lmnDCJSJ
Enthusiast
Enthusiast

Just ran into some strange thing.

 

It works with all my parameters, except my lookup parameter.

 

Whenever i try to insert a block, i cant enter other numbers except 1.

if i try to enter 8, it list "Invalid option keyword"

 

If i insert it (using 1) i have no problems with inserting it, but i cant choose the lookup option from the command line.

 

I have no clue, whats wrong...

 

The file, include a block called WALL, and I am using a lookup table to make a lot of different types.

0 Likes
Message 9 of 9

lmnDCJSJ
Enthusiast
Enthusiast

Turned out that it was my underscore that was the problem, now it works 🙂