See the top rated post in this thread. Click here

Results 1 to 6 of 6

Thread: Request: Polyline for Structural Beams

  1. #1
    Member
    Join Date
    2013-05
    Location
    Central Coast, CA
    Posts
    3
    Login to Give a bone
    0

    Question Request: Polyline for Structural Beams

    I've searched for this type of lisp, but haven't been able to find it. Hoping someone here may have it already.

    First Lisp goes like this:
    1.) Command is "Beam1"
    2.) First pick is mid point of a line (post)
    3.) Second pick mid point of a line (post)
    4.) Polyline is drawn with given width and each end REDUCES by a given distance (3" in this case)
    5.) Mtext is placed above the centerline of the beam with Mid-Center justification

    Second Lisp:
    1.) Command is "Beam2"
    2.) First pick is mid point of a line (wall)
    3.) Second pick mid point of a line (wall)
    4.) Polyline is drawn with given width and each end EXTENDS by a given distance (3" in this case)
    5.) Mtext is placed above the centerline of the beam with Mid-Center justification

    The text is not that critical. Is this doable or does anyone have a routine to share?

    Thanks - I really appreciate any help you pros can give.

    -Tom
    PLINE_LISP_REQUEST.JPG

  2. #2
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,106
    Login to Give a bone
    0

    Default Re: Request: Polyline for Structural Beams

    Quote Originally Posted by tcastro386037 View Post
    The text is not that critical. Is this doable or does anyone have a routine to share?
    Is this doable? Yes.

    Are you looking for someone to step up and write the entire thing, or do you want to learn along the way so you can do these quick routines on your own?

    To start, you will need to first ask the user for a point. You can use the getpoint function to retrieve that information. You would then ask for the second point. Once the two points are specified, you could use the distance AutoLISP function to determine the distance between the two points. You also need to find out the angle between these two points.

    After you have discovered the necessary information, you could then calculate the new points for your new beam using the polar function. Once you have the new points, you would supply that information to the proper AutoCAD commands to draw the lines and place the text.

    This is a minor routine which I am certain you could work up. Why not give it a shot and post back here for further guidance?
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  3. #3
    Member
    Join Date
    2013-05
    Location
    Central Coast, CA
    Posts
    3
    Login to Give a bone
    0

    Default Re: Request: Polyline for Structural Beams

    Thanks for the reply Opie. I guess I was hoping that someone would simply share a routine that I could tweak. I don't mind learning along the way ( which I have), but it's usually been from a "here's a routine that's similar - you can tweak it all you want". I'll figure something out.

  4. #4
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,106
    Login to Give a bone
    1

    Default Re: Request: Polyline for Structural Beams

    That helps. Thanks.

    So let's start learning along the way. I will get you started. We can then add to it as needed.

    We now need to know what points the user wants to place a beam in. So, let's ask the user for the info.
    Code:
    (setq StartPoint (getpoint "Specify first point: "))
    (setq EndPoint (getpoint "Specify second point: "))
    Here we have received the two points the user wants to work with. Now we can draw the line using the AutoCAD LINE command.
    Code:
    (command "LINE"
    	 (polar StartPoint (angle StartPoint EndPoint) extension)
    	 (polar EndPoint (angle EndPoint StartPoint) extension)
    )
    Now, let's put this all together.
    Code:
    (defun c:beam1 ()
      (setq StartPoint (getpoint "Specify first point: "))
      (setq EndPoint (getpoint "Specify second point: "))
      (command "LINE"
    	   (polar StartPoint (angle StartPoint EndPoint) 3.0)
    	   (polar EndPoint (angle EndPoint StartPoint) 3.0)
    	   "" ;_We need to end the line command
      )
    )
    Depending on your running osnap settings, this may be in the correct location. Let's clean that up a bit to make certain any running osnaps do not hinder the routine. We can do that by specifying the NONE osnap when we are drawing our line. So, let's change change these two lines as noted in red.
    Code:
    	   "non" (polar StartPoint (angle StartPoint EndPoint) extension)
    	   "non" (polar EndPoint (angle EndPoint StartPoint) extension)
    Now, the code should draw a line. We can change the line to a pline by changing the command we call. Do you want to try it?
    Last edited by Opie; 2014-01-21 at 08:02 PM. Reason: added color oops
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  5. #5
    Member
    Join Date
    2013-05
    Location
    Central Coast, CA
    Posts
    3
    Login to Give a bone
    0

    Default Re: Request: Polyline for Structural Beams

    Nice! Thanks a lot Opie - really appreciate the help and Lisp lesson. I'm going to play around with it at tweak a bit. I'll repost when I get it running how I want.

  6. #6
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,106
    Login to Give a bone
    0

    Default Re: Request: Polyline for Structural Beams

    If you tweak it right, you can combine the two routines into one sub-routine. You would then supply the sub-routine the appropriate arguments to extend or trim the desired distance. My initial code handled that, but I wanted to get you started on understanding the code.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

Similar Threads

  1. Replies: 2
    Last Post: 2012-04-30, 01:47 PM
  2. I would like the structural beams, etc. to have an option for drawing curved beams.
    By revit.wishlist1942 in forum Revit Architecture - Wish List
    Replies: 1
    Last Post: 2008-07-04, 04:56 AM
  3. Structural Beams
    By pwmsmith in forum Revit Architecture - General
    Replies: 3
    Last Post: 2004-08-06, 08:26 PM
  4. Structural beams
    By timothyj67 in forum Revit Architecture - General
    Replies: 5
    Last Post: 2003-07-16, 07:08 AM
  5. Structural beams
    By ind in forum Revit Architecture - Tips & Tricks
    Replies: 3
    Last Post: 1970-01-01, 12:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •