Author Topic: Autocad(vanilla) One Line Diagram Creation F1  (Read 1115 times)

0 Members and 1 Guest are viewing this topic.

TSQDD

  • Mosquito
  • Posts: 3
Autocad(vanilla) One Line Diagram Creation F1
« on: October 08, 2021, 12:42:27 PM »
Hello,

If anyone can help me, it would be greatly appreciated.

I do a lot of fire alarm systems. My problem is the creation of one line diagrams. I have a routine I use to copy "dynamic" blocks and "annotative" scaling. Problem is it crashes on a block that is dynamic and I end up just copying blocks to the one line and then I have to do the same thing for the room names(mtext). When you have literally hundreds of these to do, it warrants asking for assistance. I have attached the oneline routine and the error trap I use. I understand that things may be done differently in both routines.

So, the ideal situation would be to...

1.) Select a block, or dynamic block "X"
2.) Copy "X" to a oneline point
3.) Next copy of "X" move the point to the right 1.5 x DIMSCALE/ANNOTATIVE SCALE
4.) Select a block, or dynamic block "X"
5.) Repeat until done

Again, I appreciate the help.

Tim



BIGAL

  • Swamp Rat
  • Posts: 1398
  • 40 + years of using Autocad
Re: Autocad(vanilla) One Line Diagram Creation F1
« Reply #1 on: October 08, 2021, 07:45:04 PM »
Rather than just edit your code here is some suggestions.

Code: [Select]
(setq oldsnap (getvar 'osmode))
(setvar 'osmode 1) ; set snap to end reset at end of code.

Google "Lee-mac ssget" it is a good reference about using ssget to select objects
Code: [Select]
(setq ss (ssget "_+.:E:S" '((0 . "INSERT"))))  ; select only a block
(setq blk (ssname ss 0))

wrong order
Code: [Select]
(setq INSPT(list (+ (car INSPT) (* DIMSC 1.50)) (- (cadr INSPT) 0.0)))
(command ".insert" BLK2 INSPT DIMSC DIMSC 0)

I use for add X Y Z to point
Code: [Select]
(setq INSPT (mapcar '+ INSPT (list (* DIMSC 1.50) 0.0 0.0))))
A man who never made a mistake never made anything

TSQDD

  • Mosquito
  • Posts: 3
Re: Autocad(vanilla) One Line Diagram Creation F1
« Reply #2 on: October 09, 2021, 01:08:58 PM »
BigAl,

Thanks for the response. In all the years I have been drawing, I am admittedly not a code writer at all. Something I could never wrap my brain around.

I have attached my "attempt" at applying the code suggestion you made to the routine. Unfortunately it crashes.

I appreciate your help. This is something that will take me 2 days to complete via old school ways and was worthy of the attempt. It is ok, in a way, because I am paid by the hour, however, as mudane as it is, was worth the shot.

Thank you.

BIGAL

  • Swamp Rat
  • Posts: 1398
  • 40 + years of using Autocad
Re: Autocad(vanilla) One Line Diagram Creation F1
« Reply #3 on: October 09, 2021, 08:32:30 PM »
I would suggest download Notepad++ it has a lisp checker mode, I opened your code in vlide and got Extra right parenthis, so looked in Notpead++ checking match ( ) as they change colour to red so can see where wrong. Dont have extra defun (reset) so no test.
Anyway

(RESET)
(princ)
) remove
A man who never made a mistake never made anything

TSQDD

  • Mosquito
  • Posts: 3
Re: Autocad(vanilla) One Line Diagram Creation F1
« Reply #4 on: October 12, 2021, 12:26:11 PM »
BigAl,

I have used Notepad++ for years. I am just not a coder.

Thanks again.