Problems Inserting Blocks and Lines in Single Line Diagram Drawing

Problems Inserting Blocks and Lines in Single Line Diagram Drawing

kamal_kouidar
Contributor Contributor
667 Views
6 Replies
Message 1 of 7

Problems Inserting Blocks and Lines in Single Line Diagram Drawing

kamal_kouidar
Contributor
Contributor

 

Dear members of the AutoCAD Forum,

 

I'm currently running into problems inserting blocks and lines into my Single Line Diagram drawing in AutoCAD. Sometimes the blocks and lines are imported correctly, but often things go wrong and they are inserted crookedly, overlap each other, or other unwanted situations arise.

 

I've tried making several adjustments to my AutoLISP script, such as increasing the delay time between inserting consecutive blocks and lines. Despite these efforts, problems continue to arise.

 

It seems that AutoCAD sometimes has trouble handling the blocks and lines correctly, especially when inserting large numbers of objects. This causes inconsistencies and errors in the drawing, which disrupts my workflow and leads to frustration.

 

I'm wondering if there are other users who have experienced similar problems when working with Single Line Diagram drawings in AutoCAD. Does anyone have any suggestions or solutions that I could try to resolve these issues?

 

Everytime it goes wrong I get this error in my commandline & debug console of visual studio code:

 

"Too many objects selected for INTERSECT"

 

Any help or insight would be greatly appreciated.

 

Thank you.

 

Below you find the pictures, the drawing (.dwg) and the LSP script

 

Yours sincerely,

Kamal

 

This one is the WRONG insert of the blocks, lines etc

wrong inserts of lines,blocks etc.png

--------------------------------------------------------------------------------------------------

This one is the correct insert of lines,blocks etc.

correct insert of blocks, lines, square-raster.png

 

Blocks are different in the images i have more blocks don't pay attention to it 🙂

0 Likes
668 Views
6 Replies
Replies (6)
Message 2 of 7

Kent1Cooper
Consultant
Consultant

Turn off running Object Snap [F3].  That should be built into the code, and if you like, it's common to save the current OSMODE setting, turn it off within the operation, and then restore the former setting.  You will find numerous examples in this Forum.

Kent Cooper, AIA
Message 3 of 7

kamal_kouidar
Contributor
Contributor

Ah oke! thank you! Do you think that its still necessary to use the delays that I have used between my codes or can I just remove them? 

Thank you @Kent1Cooper 

0 Likes
Message 4 of 7

Kent1Cooper
Consultant
Consultant

@kamal_kouidar wrote:

Ah oke! thank you! Do you think that its still necessary to use the delays that I have used between my codes or can I just remove them? 


I would remove them, and the (while) functions they're in, which look mostly pointless [I haven't studied all of them -- but the first one would do nothing].  The DELAY command is really intended for use in SCRIPTs, and I've always found it questionable whether it really does anything in AutoLisp.  They are one of the things that looked kind of weird to me in the code, if not actually "wrong."  [There are some others, too, including some that are actually wrong, like (command "\nEnter").  But first, does it work right for you with Osnap off?]

Kent Cooper, AIA
Message 5 of 7

kamal_kouidar
Contributor
Contributor

Yes the object snapping off works well. Thank you for your help I will check if it still works wel when I remove the delays, enters and while loop.

 

Thank you!

0 Likes
Message 6 of 7

ec-cad
Collaborator
Collaborator

Kamal,

Basic problem was in block coordinate setup. Added (setq dis_down 42.9611) ; Distance Down from (top) of 1st Line

Also, had an extra ')' in one of the function's. Moved the order of functions in Main.

Removed all the 'delay  stuff, so I could see the code better. Just me.

ECCAD

 

0 Likes
Message 7 of 7

kamal_kouidar
Contributor
Contributor

Thank you for your help! @Kent1Cooper gave me the right answer for my problem. And with that I solved it! Thanks again for your effort!

0 Likes