Author Topic: objects connected via pline  (Read 4172 times)

0 Members and 1 Guest are viewing this topic.

mbrandt5

  • Newt
  • Posts: 44
objects connected via pline
« on: July 14, 2017, 05:02:24 PM »
 :mrgreen:
So does anyone know of a lisp that exists that will do the following...trying to save myself the hassle of writing the code and scrambling the web.

-Prompt you to select multiple objects (Objects A)
       (Extract the base points of Objects A) -Store those Base points

-Select Object B
       (Extract the base points of Object B) -Store that Base point

-Draw polylines from basepoint of Objects A to base point of Object B via  90 degree angles

...A bonus would be if it did all of this within a selected polyline



Lee Mac

  • Seagull
  • Posts: 12905
  • London, England
Re: objects connected via pline
« Reply #1 on: July 15, 2017, 09:25:15 AM »
A sample image/drawing would help  :-)

mbrandt5

  • Newt
  • Posts: 44
Re: objects connected via pline
« Reply #2 on: July 17, 2017, 11:58:13 AM »
Sorry about that

- The Circles with A, are the group A objects (blocks)
- The Rectangle is the group B object
(The blue line is the polyline I was referring to that the lines would hopefully stay within, also if they followed same paths that'd be cool)

The ideal lisp would autopopulate the plines between the two groups
« Last Edit: July 18, 2017, 02:08:28 PM by mbrandt5 »

mbrandt5

  • Newt
  • Posts: 44
Re: objects connected via pline
« Reply #3 on: July 18, 2017, 04:29:50 PM »
If there isn't anything similar....

If anyone could suggest a reference lisp for the three things I'd need to figure out which would be...

1.Drawing a PLine to the x coordinate or y coordinate of object b...which with polar snap of 90 degrees maybe just entering the x and y coordinate would work??
This did not work by the way, would perfer to do this without extracting changing to numbers and subtracting "If possible"

2. Keeping the populated lines in the object?

3.Making the PLines turn? with other PLines?
Assuming it'll take estraction and subtraction of coord.s
« Last Edit: July 18, 2017, 05:25:08 PM by mbrandt5 »

ronjonp

  • Needs a day job
  • Posts: 7526
Re: objects connected via pline
« Reply #4 on: July 18, 2017, 05:41:16 PM »
So in your example, is object 'b' the base and is there only one? There are a few different routes at 90 degree angles.
« Last Edit: July 18, 2017, 05:50:12 PM by ronjonp »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

mbrandt5

  • Newt
  • Posts: 44
Re: objects connected via pline
« Reply #5 on: July 19, 2017, 09:10:53 AM »
That is correct the plines could start at the base point, I believe CONS 10, that draw to the X or Y coords of each A object branching off as shown, in the picture above. 

I found a command online that draws plines from a common base point that is selected, which I could use as a good starting point.

Code: [Select]
DEFUN C:PBB ()
(PROMPT "\n*POLYLINE BY BASEPOINT* ")
(SETQ BP (GETPOINT "Specify base point: "))
(SETQ LP 1)
(WHILE LP
(COMMAND "PLINE" BP)
(SETQ LP2 1)
(WHILE LP2
(IF (= (GETVAR "CMDACTIVE") 1)
(PROGN
(PROMPT "\nSpecify next point or [Arc/Close/Halfwidth/Length/Undo/Width]: ")
(COMMAND PAUSE)
);END PROGN
(SETQ LP2 NIL)
);END IF
);END LP
);END LP
(PRINC)
);END PBB

Also, not to familiar with VLAX, some experience. While this draws a line to a curve, I think its cons 10 first point cons 11 second, etc. 
I think some variation of this addition to that code could come i handy as well.

Code: [Select]
(entmake (list '(0 . "LINE") (cons 10 (trans BT 1 0))
(cons 11 (vlax-curve-getClosestPointTo entity (trans BT 1 0)))) ;_ list
) ;_ entmake

ronjonp

  • Needs a day job
  • Posts: 7526
Re: objects connected via pline
« Reply #6 on: July 19, 2017, 12:42:52 PM »
Something like this?  8)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

MSTG007

  • Gator
  • Posts: 2598
  • I can't remeber what I already asked! I need help!
Re: objects connected via pline
« Reply #7 on: July 19, 2017, 01:18:02 PM »
Pretty crazy cool.
Civil3D 2020

ronjonp

  • Needs a day job
  • Posts: 7526
Re: objects connected via pline
« Reply #8 on: July 19, 2017, 02:05:18 PM »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

mbrandt5

  • Newt
  • Posts: 44
Re: objects connected via pline
« Reply #9 on: July 28, 2017, 03:01:03 PM »
That is exactly what I am looking for! :yay!: :yay!:

Any chance you'll share?

ronjonp

  • Needs a day job
  • Posts: 7526
Re: objects connected via pline
« Reply #10 on: July 28, 2017, 03:09:27 PM »
That is exactly what I am looking for! :yay!: :yay!:

Any chance you'll share?
I'll have to see if I can get it working again .. was messing around with other sorting algorithms and broke it  :oops: .

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

mbrandt5

  • Newt
  • Posts: 44
Re: objects connected via pline
« Reply #11 on: July 28, 2017, 03:35:38 PM »
Okaledokale!

mbrandt5

  • Newt
  • Posts: 44
Re: objects connected via pline
« Reply #12 on: August 17, 2017, 10:55:48 AM »
Any luck NinJon

ronjonp

  • Needs a day job
  • Posts: 7526
Re: objects connected via pline
« Reply #13 on: August 17, 2017, 11:48:26 AM »
I have not had time to look at this. Sorry.

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

ribarm

  • Gator
  • Posts: 3225
  • Marko Ribar, architect
Re: objects connected via pline
« Reply #14 on: August 19, 2017, 03:19:38 PM »
Regards, M.R.
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube