Insert Block at Coordinates

Insert Block at Coordinates

anieves228
Enthusiast Enthusiast
600 Views
6 Replies
Message 1 of 7

Insert Block at Coordinates

anieves228
Enthusiast
Enthusiast

Hello all,

 

Im at a loss here. I did a lisp to insert a PE seat at a specific coordinate, it does not register the Y coordinate. Im not sure what happened because  I have used this method in the past. It registers the X coordinate but it puts the Y coordinate at 1.556. I have changed the Y to several different values but doesn't change unless I put 3 or more. 

 

	(DEFUN C:APDMS ()
		(SETVAR "CMDECHO" 1)

			(COMMAND "-LAYER" "M" "DWG-SEAL" "L" "CONTINUOUS" "" "LW" "0" "" "S" "0" "")					;SEAL LAYER

			(SETVAR "CLAYER" "DWG-SEAL")

			(COMMAND 
				"-INSERT" 
				"Z:/Shared/zCAD/Automation/Seals/Derek Meyers - SEAL.DWG"
				(LIST 29.7 2.5)
				"1"
				"1"
				"0"
			)	

			(command "explode" "last")

		(SETVAR "CMDECHO" 1)
		(PROMPT "\n AUTOPLACED DEREK MEYERS SEAL \n")
		(PRINC)
	)

  

0 Likes
Accepted solutions (2)
601 Views
6 Replies
Replies (6)
Message 2 of 7

paullimapa
Mentor
Mentor
Accepted solution

What if you set osmode to 0 and then try again?


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 3 of 7

anieves228
Enthusiast
Enthusiast

That worked!

 

The question I have now is why?

0 Likes
Message 4 of 7

DGCSCAD
Collaborator
Collaborator

I've had a similar issue that was throwing off insertion points, but only on certain users PC's. After comparing each list of system variables, I found the culprit to be that OSNAPCOORD was set to 2 on some of them.

 

Setting  it to 1 smoothed it out:

 

(setvar "OSNAPCOORD" 1)

AutoCad 2018 (full)
Win 11 Pro
Message 5 of 7

paullimapa
Mentor
Mentor

When you have running object snaps set the insert command will look for the closest effective osnap. 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 6 of 7

paullimapa
Mentor
Mentor

To add to @DGCSCAD  post read up on this


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 7 of 7

ec-cad
Collaborator
Collaborator
Accepted solution

You can get around how the user's machine is setup for OSnaps.

Key is in system variable 'OSMODE

Top of your Lisp, do:

(setq OSM (getvar 'OSMODE))

(setvar 'OSMODE 0)

---- your remaining code

Then, at bottom before exit, do:

(setvar 'OSMODE OSM)

 

ECCAD