TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: S.Langhammer on June 22, 2016, 05:19:17 AM

Title: Wrong insertion point upon automated insertion in BricsCAD with LISP
Post by: S.Langhammer on June 22, 2016, 05:19:17 AM
Hey,

I'm currently working on a routine to pick specific drawings, to import their model space and save it as block in the currently open drawing.

I've attached the scipt, that came out so far and a block on which I noticed the problem, to this post.

I'm Working With BricsCAD V16.  When I use the IMPORT and -BLOCK commands manually, everything works just fine.
Once I'm using the automated script, the insertion point is stuck on the solid somewhere. It would be really important, that the insertion point for the generated blocks is in the right place.

Anyone got an idea what the soruce of this problem is or even how I could solve it?
Title: Re: Wrong insertion point upon automated insertion in BricsCAD with LISP
Post by: ronjonp on June 22, 2016, 08:35:21 AM
Move your block to '(0. 0. 0.) .. right now it's sitting 0.6 units to the left.
Title: Re: Wrong insertion point upon automated insertion in BricsCAD with LISP
Post by: S.Langhammer on June 22, 2016, 09:33:52 AM
Sorry, but that is exactly what I want to avoid. All graphics should remain exactly where they are in the original files.
Title: Re: Wrong insertion point upon automated insertion in BricsCAD with LISP
Post by: Marc'Antonio Alessi on June 22, 2016, 09:34:14 AM
Move your block to '(0. 0. 0.) .. right now it's sitting 0.6 units to the left.
Or use the BASE command, ...but is better move to 0,0,0   :|
Title: Re: Wrong insertion point upon automated insertion in BricsCAD with LISP
Post by: danallen on June 22, 2016, 11:23:51 AM
watch out for osnaps? does using -INSERT instead of IMPORT, and using the auto created block definition help you?
Title: Re: Wrong insertion point upon automated insertion in BricsCAD with LISP
Post by: huiz on June 23, 2016, 01:53:36 AM
In AutoCAD the variable OSNAPCOORD is default 2, which means priority for Coordinate Data Entry will use keyboard entry first except scripts. Lisp and Scripts will snap to objects when coordinates are entered, while keyboard entry will use the given coordinates.

I assume BricsCAD has the same system variable.

You can set it to 1 (at top of your script) or temporary disable Object Snap at the beginning of your lisp routine.
Title: Re: Wrong insertion point upon automated insertion in BricsCAD with LISP
Post by: S.Langhammer on June 23, 2016, 02:00:47 AM
watch out for osnaps?

Thanks! That was exactly it!

You can set it to 1 (at top of your script) or temporary disable Object Snap at the beginning of your lisp routine.

I'll probably go with the disabled snaps. Thanks a lot!
Title: Re: Wrong insertion point upon automated insertion in BricsCAD with LISP
Post by: ur_naz on June 25, 2016, 10:33:35 AM
Put your look on vla-InsertBlock
Title: Re: Wrong insertion point upon automated insertion in BricsCAD with LISP
Post by: S.Langhammer on June 27, 2016, 04:33:05 AM
Put your look on vla-InsertBlock

Thanks for the tip. That ruled out an error on a collegue's machine.
Say, does vla-InsertBlock regard system variables like osmode, 3dosmode and insunits?
If not, I think I can kill the handling in my script.
Title: Re: Wrong insertion point upon automated insertion in BricsCAD with LISP
Post by: Marc'Antonio Alessi on June 27, 2016, 07:54:31 AM
Sorry, but that is exactly what I want to avoid. All graphics should remain exactly where they are in the original files.
as said: use the BASE command on the original file.