insert prompt

insert prompt

Anonymous
Not applicable
1,745 Views
11 Replies
Message 1 of 12

insert prompt

Anonymous
Not applicable

Hi,

 

I made a simple routine that inserts a block, but on some of the computers it fails to insert them.

After some checking, i realized that i get different prompts when using the "-insert" command.

On some of the computers i'm asked for the scale on x, then for scale on y (non-uniform scale). On the others I'm asked only for the scale on x,y and z in one question (uniform scale).

I couldn't locate the variable that triggers this behavior.

 

Any help would be highly appreciated.

 

Thank you,

Adrian

0 Likes
Accepted solutions (1)
1,746 Views
11 Replies
Replies (11)
Message 2 of 12

ВeekeeCZ
Consultant
Consultant
Accepted solution
Use
(command "_.insert" "blockname" "_scale" 1 "_rotate" 0 "_none" pnt)
Message 3 of 12

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

....

On some of the computers i'm asked for the scale on x, then for scale on y (non-uniform scale). On the others I'm asked only for the scale on x,y and z in one question (uniform scale). ....


That should be a function of the definition of the Block, not a difference between settings on different computers.  Specifying the Scale option [which will ask for one scale to apply uniformly, whether or not the Block is defined for uniform scaling], before the insertion point, as @ВeekeeCZ suggests, is the way to overcome the difference.  [Whether you also specify the rotation angle  beforehand is up to you.]

 

If you're really getting different prompts on different computers for the same Block, can you post a drawing with that Block in it, or the drawing file that is that Block definition, and the command-line histories of insertions of it on different computers?  Might there be more than one definition, one for uniform scaling and the other not, possibly one internal to a certain drawing and the other internal to another, or the other as an external drawing file?  Are they pulling the Block definition from the same place?

Kent Cooper, AIA
0 Likes
Message 4 of 12

Anonymous
Not applicable

Thank you BeeKeeCZ !!

That did the trick !!

I would still be curious what generates the different prompts.

0 Likes
Message 5 of 12

Anonymous
Not applicable

I have only one script file that the whole team is using.

The blocks are also located on the server, together with the projects, so everybody loads the same block file.

I ran the tests on new files as well as on existing files.

 

the code looks like this:

 

(command-s "-insert" "slopearrow" '(0 0 0) myVPscale "" "0")

 

I attached screenshots with the two different prompts that i get.

 

BeekeeCZ's solution is a good workaround, but it doesn't help me understand why am I getting these prompts.

 

I added the block too.

0 Likes
Message 6 of 12

ВeekeeCZ
Consultant
Consultant

@Anonymous wrote:

 

....

I would still be curious what generates the different prompts.


 

image.png

0 Likes
Message 7 of 12

Anonymous
Not applicable

I turned on and off the 'uniform scaling' but this doesn't changer the prompt in autolisp.

0 Likes
Message 8 of 12

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

I turned on and off the 'uniform scaling' but this doesn't changer the prompt in autolisp.


Right -- that's the question.  @ВeekeeCZ, whether the Block is defined for uniform scaling can only explain the scaling prompt(s) you [should]  get when Inserting it [if you don't pre-empt them with the Scale option].  It doesn't explain why the prompts are not the same for the same Block on different computers, as one would certainly expect them to be.  I'm at a loss....

 

And it raises a question in my mind:  If I make a Block definition, set for uniform scaling, and then WBLOCK that out to make a separate drawing file, when I Insert that resulting drawing to become a Block in some other  drawing, it comes in designed for uniform scaling [i.e. I can't un-check the uniform scaling button in the Insert dialog box].  I didn't expect that, because I thought it was a function of a Block definition within  a drawing, but that a plain-old drawing wouldn't know about it, and once a Block definition is Wblocked out, the resulting drawing would lose that feature.  So the question is, what is it in that resulting drawing file that limits it to uniform scaling when that drawing is Inserted to become a Block in another drawing?  If I am making a drawing that I will be Inserting as a Block in other drawings, is there any way from within  such a drawing [which has never yet been a Block definition] to set it up for uniform scaling?  I haven't found any System Variable or anything, but I may not have searched for the right terminology.

Kent Cooper, AIA
0 Likes
Message 9 of 12

Anonymous
Not applicable

One more step towards solving the mystery.

 

I was thinking, since there is no direct way to change the behavior of the insert command, maybe there are variables that change the behavior of AutoCAD, indirectly changing the prompt for insert.

One of these is SDI, which doesn't change only the number of documents that can be opened in a session, but changes other things too, like the xref dialog window and other things. Generally makes AutoCAD behave like an older AutoCAD.

When I changed SDI from 0 to 1 on my computer, the insert prompt changed to the old style, allowing only uniform scaling.

Still, there is another part to find. On some of the computers, although my colleagues use SDI 1, insert works with the non uniform scale prompt. So there is another unknown variable that controls the behavior of insert when SDI is 1.

 

0 Likes
Message 10 of 12

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

....

When I changed SDI from 0 to 1 on my computer, the insert prompt changed to the old style, allowing only uniform scaling.

....


Actually, the "old style" was always to ask for both X and Y scales [unless pre-empted by the Scale option first] -- the possibility of defining a Block for uniform scaling is a newer feature.

Kent Cooper, AIA
0 Likes
Message 11 of 12

Paul_Gander
Advocate
Advocate

@Kent1Cooper wrote:

If I am making a drawing that I will be Inserting as a Block in other drawings, is there any way from within  such a drawing [which has never yet been a Block definition] to set it up for uniform scaling? 

You can open the block editor (without pre-selecting a block) and choose <current drawing> from the list of block names presented. Change the uniform scaling property, close the editor and save the drawing file.

 

The setting seems to be the Blockscaling ActiveX property (0 = any scale, 1 = uniform) but i have very little experience of using the vlax- lisp commands so I can't offer more than that at the moment.

 

0 Likes
Message 12 of 12

arionXMSF7
Contributor
Contributor

The reason for the behavioral difference is partly due to the block defintion as noted above, but the reason the behavior is different on different machines is not related to that. The answer is the AutoLISP function (initcommandversion). Play around with setting the version to 1 or 2 immediately before your insert command to change the behavior. Here is the documentation on this function: 

 

http://docs.autodesk.com/ACD/2013/ENU/index.html?url=files/GUID-1C989B35-2C5A-47EC-A0C9-71998EDFB157...

0 Likes