Jump to content

How to bypass the UNITS / conversion input from an INSERT command?


Recommended Posts

Posted

Why does this code crash in 2012 ? It's just a simple insert command that has never been a problem

 

  (command "_.LAYER" "_ON" "0" "_Thaw" "0" "_Unlock" "0" "_Set" "0" "")
  (command "_.VPOINT" '(0 0 1)
           "_.UCS" "_W"
           "_.PLAN" "_W")
  (command "_.INSERT" (strcat m f) '(0 0 0) 1 1 0)

 

Text history :

Command: _.UCS
Current ucs name:  *WORLD*
Specify origin of UCS or [Face/NAmed/OBject/Previous/View/World/X/Y/Z/ZAxis] 
<World>: _W
Command: _.PLAN
Enter an option [Current ucs/Ucs/World] <Current>: _W Regenerating model.

Command: _.INSERT Enter block name or [?]: c:/0-fx2/r14/ABA011 Substituting 
[simplex.shx] for [txt].
Substituting [simplex.shx] for [txt].

[color="red"]Units: Millimeters   Conversion: 0.03937008[/color]
Specify insertion point or [basepoint/Scale/X/Y/Z/Rotate]:
Enter X scale factor, specify opposite corner, or [Corner/XYZ] <1>: 1 Enter Y 
scale factor <use X scale factor>: 1
Specify rotation angle <0>: 0

 

I've never run into this before. and it's driving

me nuts

 

:x

 

 

-David

Posted

Try the entmake route. Note that the block looks like 1:1, but the Scale and the Scale Factor are affected by your settings.

(entmakex
 (list
   '(0 . "INSERT")
   (cons 2 (strcat m f))
   '(10 0.0 0.0 0.0)
   '(41 . 1.0)
   '(42 . 1.0)
   '(43 . 1.0)
   '(50 . 0.0)
 )
)

Posted

So far so good

 

(command "_.INSERT" (strcat m f))
(command)
(entmake (list (cons 0 "INSERT")(cons 2 f)(list 10 0 0 0)))

 

A lot a unnecessary work. But it is working

 

Thanks! -David

Posted

1 of the crazy parts of this is that I had converted all 400 files I'm having to deal with back Release 14 so I wouldn't have to mess with this type of junk.

 

Apparently some of the 400 files had been created using a metric template, the balance imperial.

 

-David

Posted

Have you tried setting INSUNITS=0 and INSUNITSDEFTARGET=0?

 

( EDIT: Too slow - I see you have posted a link explaining this )

Posted

Finally found some info. I take it doesn't matter how the file was created, it is the settings in the file that is being inserted into.

 

I also take it these sysvars are turned on (1) by default if a template file is not used to start a new drawing. Which I do quite a lot

 

Thanks! -David

Posted
Finally found some info. I take it doesn't matter how the file was created, it is the settings in the file that is being inserted into.

 

I also take it these sysvars are turned on (1) by default if a template file is not used to start a new drawing. Which I do quite a lot

 

Thanks! -David

Sorry David, I took literally "bypass the UNITS" when I've made my suggestion, assuming you know about these sysvars.

Posted
Sorry David, I took literally "bypass the UNITS" when I've made my suggestion, assuming you know about these sysvars.

 

 

That's OK. I don't use these newer releases unless I absolutely have to in developing routines for clients. But yours did work as advertised !

 

I blame AutoDesk for breaking backward compatibilty in the command sequence. Shame on them ! ie The EXPLODE command in AutoLISP still expects a single ename in AutoLISP -David

Posted
The EXPLODE command in AutoLISP still expects a single ename in AutoLISP -David

 

QAFLAGS = 1... But not my advice to use it in code, only if you have to, and make sure you reset it back to 0... To be sure and what is my advice : put (setvar 'QAFLAGS 0) in acaddoc.lsp, so you may never experience issues like not working ACET- functions and turning LAYER dialog box with calling (command "_.-LAYER" ... ) from AutoLisp, and ... (who knows what else is wrong when QAFLAGS=1 and you are lisping...)

Posted

QAFLAGS I agree, only if absolutely needed. -David

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...