Jump to content
Sambuddy

LISP & Dynamic Blocks - Tower Profile

Recommended Posts

Sambuddy

Good afternoon,

I am not sure if this can be done but since everything I asked are addressed by genius programmers on this site, I am going to ask my question.

As you can see on the DWG I attached, I have different sizes for tower profiles. Values for X0 is an offset before first horizontal element is drawn at both ends.Value for X1 (begining and end of each tower is the same but different than X2 since X0 exists at both ends), value for X2 (the rest of segments are the same). however number of segments for X2 varies depending on tower manufacturer. Example: total segments could be 10 or 12 etc... . The white lines on the snapshot would represent the centerline of the elements (either pipe OR center of bolts for angles). Is there a way to automate this process with a LISP for a window to open and ask whether it is solid rounds or angle then prompts to a bunch of value entries to then generate the profile? It would also be awesome to generate the plan view but I can give more information if anyone is interested.

 

Alternatively, if I can, I could come up with drawing the skeleton (only centerline as shown on the snapshot) in dynamic block to stretch both vertically and horizontally and give them different layer names, example: all horizontals to be under layer A, all diagonals to be under layer B, and 2 vertical (LEG) lines to be under layer C, then by your magic in writing a lisp to be able to open up a dialog box that asks me what is the size for A/B/C to create the offset but it has to also trim the joints where horizontal and diagonal meet the vertical (LEG) as shown in DWG and of course different scenario when I am dealing with angles.

 

Do you think if this is possible at all through either option? It would be excellent if LISP & DCL could ask a bunch of questions then execute without any dynamic block but either way requires your thoughts!

 

Please and thank you 

image.png.24c21656205f5e8d15eedc25949fd9ae.png

 

on the Angle (LEG) portion: would it also be possible to come up with a dialog box to ask values for these variables (snapshot below and also under LEG_Detailed in CAD file) then generate this detail?

of course the profile for angle legs is dependant on this detail but if I can get this detail by itself it wold be a great help! 

image.png.4a7777cfab1b2c2b49d423787897b23a.png

 

Please and thank you

LMR33_LEBLANC TOWERS.dwg

Share this post


Link to post
Share on other sites
BIGAL

Don't double up your posts I have started to answer your request in other post.

 

Admin should be put in other post.

 

What I posted which was a start for the bracing yes could replace the bracing lines with the correct section. The obvious thing is if your going down this path your line diagram must be correct. The bracing does not meet at a single point rather 3 individual points. Again this diagram could be programmed based on user input.

 

The spacing would be based on the bolt holes. If your unsure about lisp then you could use excel to work out the co-ords of the bolt holes and draw circles and lines. You can copy and paste a column from excel to Autocad to draw simple objects like lines and circles.

 

Re the angle bracket if you google dynamic blocks you will find some youtubes, have a go and if stuck post your dwg with questions.

 

If you look into learning lisp using the Polar command you can draw the angle bracket very simply, just pick a start point and work out points using polar pt angle distance.

 

image.png.63941fc627e493ad11b059500b8a07fe.pngimage.png.b436c02db45aa15623125d57aa3e706f.png

Edited by BIGAL

Share this post


Link to post
Share on other sites
Sambuddy

Good morning BIGAL,

I am sorry for doubling my post. I thought every new thought should have new topic name and post.

This is what I was trying to achieve but of course if a LISP can get it done without any dynamic blocks that would be excellent!

The numbers in front of these windoes would represent the steps or stages depending on what I select.

Thanks

SKETCH_1.thumb.jpg.f2c2daefd1e1623bca7e795b9b9a656c.jpgSKETCH_3.thumb.jpg.01512d74c74cafa55ce8f1d9ebd92118.jpgSKETCH_2.thumb.jpg.775097d6678e5c9b37bed6752c282e76.jpg

Share this post


Link to post
Share on other sites
Sambuddy

Good morning BIGAL,

This is a sample of a guy tower with bolt tubes at each segment. These towers have existed since 1970s. I have to draw them prior to proposing any new antenna location which of course differs in pipe size at each splice as it goes up. This sample is only for solid rounds but as I mentioned on my previous posts there is also a common Angle LEG instead of all welded solid rounds or pipes.

Thanks

I was going to send you these in a private message but the site keeps telling me "You are only allowed to send 0 messages per day. Please try again later." since last Friday.

 

Edited by Sambuddy

Share this post


Link to post
Share on other sites
Sambuddy

Good afternoon BIGAL,

 

I did try to go through a dynamic block but apparently I cannot sketch and array at the same time. In addition, offset seems to be a pain. Could you please take a look at my sketch proposal (posted above) and let me know if something like that (multi stage dialog boxes for case to case processes) can be done? After much thought I came to a decision that your fee is well worth what I am trying to achieve here however your assistance are needed for two things:

if there is any other idea you may have or later in the process I would have, could you implement ? (example similar setup but different tower configuration) helping me with updating your coding - I may need to fine tune the plan and profile when I see it done by your lisp.

And, I have already told you about my situation. I hope you could reduce your fees slightly (I know you are a CAD GURU and your talent is well beyond me negotiating the price) but if you could I would appreciate the sentiment.

 

Please let me know if it is possible to have, upon entering the command: Window #3 to appear and ask what model of tower I want to draw, then giving me the details such as (previously posted dwg: LMR33... above - that is LEG detail, plan and profile). Of course bolt holes may vary but distance from an outer edge of say an angle LEG to centerline of the bolt can be shown since bolt size and drilled holes are different and sometimes we need to show either or.

for 3C on the sketch) if D10 distance is entered as 0, then only a trapezoid would be drawn.

for 3B) it is similar to a guy tower but HSS will be used in lieu of solid rounds for the LEGS.

we of course have 2 general models: 3 sided and 4 sided towers.

and last, I am not sure if there is an option to enter the amount in either imperial (inches only) or metric (mm only) then however the data entry is in inches all generated views should be in mm. I am not sure if this is possible but knowing what you can do I am sure you will find a way if there is one.

thanks 

Share this post


Link to post
Share on other sites
BIGAL

So you are working for which company ? Or just copying something that someone else has paid a lot of money to produce ?

 

That aside if you just want dialogue input then that's all done as I have code for that and posted here for free. The list dcl, couple of free options out there.

 

This is the code call.

(if (not AH:getvalsm)(load "Multi Getvals.lsp"))

(setq ans (AH:getvalsm (list "Angle leg" "Angle Dist 1" 5 4 "100" "Overall Dist 2" 5 4 "250" "Plate thickness" 5 4 "10" "Bolt edge dist 1" 5 4  "50" "Bolt edge dist 2" 5 4  "100")))

 

image.png.0dcbaf86e8f2a477cf3fed006ae3fe45.png

 

(if (not AH:Butts)(load "Multi Radio buttons.lsp"))
(if (= but nil)(setq but 1))
(setq ans (ah:butts but "V"  '("Choose type" "Guy 3 sided" "Guy 4 sided" "Tri Pole" "Self supp")))
 

 

image.png.a816c830d477a1a529bea57786a767e2.png

 

You can get the dcl code from the download area here at cadtutor.

 

Sorry no fee discount I can see this task snowballing in what is required.

Edited by BIGAL

Share this post


Link to post
Share on other sites
Adju

I have been working for the last 17 years in the telecommunication towers. Climbing and surveying with my measuring tape all kind of structure (LeBlanc, Trylon, Westower, etc.)

I did a lot of drawings too. What Sambuddy is asking for would be great, but would be a hell of a job to program...

At work, we draw each models of tower for each manufacturers and usually it's the same structures, with slight, differences, that we encounter on various sites.

They, the manufacturers, invest a lot of money in the engineering for a tower model. They want to sell a lot of those to make some money.

Some software like BoCad are specialized for telecommunication, but it cost a lot.

 

Can i ask where you working Sambuddy ? I mean in what country ?

Share this post


Link to post
Share on other sites
Sambuddy

Hi BIGAL,

I take issue with your insinuation of "So you are working for which company ? Or just copying something that someone else has paid a lot of money to produce ?"

I, too, as Adju just explained in details, need to draw an EXISTING tower plan and profile each time - and your first thought is that I am steeling?

 

Companies like Leblanc and Trylon have existed since 1970s but bought and sold several times in US and Canada. They no longer exists but their towers are being modified to add or remove antennas and equipment. I am simply trying to draw existing towers to reduce drafting time for EXISTING towers. I am not certain what it is you think I am copying that someone had paid a lot of money for!

If I am designing a tower, I simply draw from scratch with analysis input - I would not need to copy from any source, because solid round 41 or 44 do not exist today which I have to draw. Nor do I bent my angle (for angle leg) at a certain distance, because legs today can be found pre-fabricated with 60 deg instead of 90 deg specifically designed for towers.

 

All the reasons for you not to assume that someone is copying what someone else paid a lot of money for!

Share this post


Link to post
Share on other sites
Sambuddy

 

 

Thanks,

 

Edited by Sambuddy

Share this post


Link to post
Share on other sites
BIGAL

Sambuddy you should be aware that there is a lot of copyright breaching and it is seen here at Cadtutor all the time, you have confirmed that your legitimately as a company looking for answers so will take that on board. I have been here at Cadtutor for around 5 years and pushing 12,000 posts, I have personally been involved in a company stealing my work for financial gain.

 

AS Adju said its a massive task but it can be broken down into bits and gradually developed. 

 

Re your bracket the simplest method is a pline outside edge, offset thickness then add cap ends, rejoin back to one pline, this removes need for sin/cos on shorter sides, I was about to do it.

Edited by BIGAL

Share this post


Link to post
Share on other sites
Sambuddy

For anyone interested in tower plan and profile - I have just fine tuned my tower design. The froms are all in excel developed by myself but "rlx" has written a simple but beautiful LISP to help transfer the data from excel to cad (it was not possible without his help).

It is now up and running and can generate three style of common towers. Special thanks to BIGAL for providing feedback to better the concept.

I am hoping I am not violating the forum but for anyone interested I can send you a copy of the file. I even included instruction for the cells and also double click to convert imperial to metric and left click to paste entry - which was a pain but a nice accomplishment.

Thanks

image.thumb.png.ffc34cee342ebd128cac7fc93756b290.png

image.thumb.png.64e8d2b16d7fc58e740a3ba82355c835.png

image.png.22e6750696ae32875eb3c5f8d776089d.pngimage.thumb.png.d380fe587b480fdba9852e533757ad5d.png

image.thumb.png.82424556f8e2f3813a6d1ea677f285a6.png

Share this post


Link to post
Share on other sites
BIGAL

The end product looks good, you can use excel to drive autocad its a two way street.

 

(setq *ExcelApp% (vlax-get-or-create-object "Excel.Application")) this is Vlisp opens the link to excel, but can do the same in VBA but Autocad.Application not something I have done in that direction. Then use the VBA add.object method. Just look up Autocad help for VBA.

 

This example draws a line controlled from excel. Note does not work with LT.

Sub Opendwg()
 
Dim acadApp As Object
    Dim acadDoc As Object
    Dim lineobj As Object
    
 'Check if AutoCAD application is open. If is not opened create a new instance and make it visible.
    On Error Resume Next
    Set acadApp = GetObject(, "AutoCAD.Application")
    If acadApp Is Nothing Then
        Set acadApp = CreateObject("AutoCAD.Application")
        acadApp.Visible = True
    End If
 
    'Check (again) if there is an AutoCAD object.
    If acadApp Is Nothing Then
        MsgBox "Sorry, it was impossible to start AutoCAD!", vbCritical, "AutoCAD Error"
        Exit Sub
    End If
    On Error GoTo 0
 
    'If there is no active drawing create a new one.
    On Error Resume Next
    Set acadDoc = acadApp.ActiveDocument
    If acadDoc Is Nothing Then
        Set acadDoc = acadApp.Documents.Add
    End If
    On Error GoTo 0
  
    'Check if the active space is paper space and change it to model space.
    If acadDoc.ActiveSpace = 0 Then '0 = acPaperSpace in early binding
        acadDoc.ActiveSpace = 1     '1 = acModelSpace in early binding
    End If

' This example adds a line in model space

    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double
    
    ' Define the start and end points for the line
    startPoint(0) = 1#: startPoint(1) = 1#: startPoint(2) = 0#
    endPoint(0) = 5#: endPoint(1) = 5#: endPoint(2) = 0#

     
    ' Create the line in model space
    Set lineobj = acadDoc.ModelSpace.addline(startPoint, endPoint)
    acadApp.ZoomExtents
        
End Sub

 

 

 

 

 

Edited by BIGAL

Share this post


Link to post
Share on other sites
Sambuddy

Thanks again BIGAL,

This is great - I am now changing my code to incorporate this onto VBA.

 

giphy.gif

Share this post


Link to post
Share on other sites
BIGAL

Have another look added Line, circle, pline run the alan1 alan2 alan3 after running opendwg. These are examples of how to do the call ! Note it will start your autocad if not already open. There is more options to most of the commands. need  a change layer, just google they are all out there.

 

For anyone interested GetObject(, "BricscadApp.AcadApplication")

 

  
Sub Opendwg()
 
    Dim acadApp As Object
    Dim acadDoc As Object

 'Check if AutoCAD application is open. If is not opened create a new instance and make it visible.
    On Error Resume Next
    Set acadApp = GetObject(, "AutoCAD.Application")
    If acadApp Is Nothing Then
        Set acadApp = CreateObject("AutoCAD.Application")
        acadApp.Visible = True
    End If
 
    'Check (again) if there is an AutoCAD object.
    If acadApp Is Nothing Then
        MsgBox "Sorry, it was impossible to start AutoCAD!", vbCritical, "AutoCAD Error"
        Exit Sub
    End If
    On Error GoTo 0
 
    'If there is no active drawing create a new one.
    On Error Resume Next
    Set acadDoc = acadApp.ActiveDocument
    If acadDoc Is Nothing Then
        Set acadDoc = acadApp.Documents.Add
    End If
    On Error GoTo 0
  
    'Check if the active space is paper space and change it to model space.
    If acadDoc.ActiveSpace = 0 Then '0 = acPaperSpace in early binding
        acadDoc.ActiveSpace = 1     '1 = acModelSpace in early binding
    End If

 End Sub
 
Public Sub addline(x1, y1, z1, x2, y2, z2)
  
 ' Create the line in model space
    Dim acadApp As Object
    Dim acadDoc As Object
    Set acadApp = GetObject(, "AutoCAD.Application")
    Set acadDoc = acadApp.ActiveDocument

    Dim startpoint(0 To 2) As Double
    Dim endpoint(0 To 2) As Double
    Dim lineobj As Object

    startpoint(0) = x1: startpoint(1) = y1: startpoint(2) = z1
    endpoint(0) = x2: endpoint(1) = y2: endpoint(2) = z2

    Set lineobj = acadDoc.ModelSpace.addline(startpoint, endpoint)
    acadApp.ZoomExtents
    
    End Sub
    Public Sub addcirc(x1, y1, z1, rad)
  
 ' Create the circle in model space
    Dim acadApp As Object
    Dim acadDoc As Object
    Set acadApp = GetObject(, "AutoCAD.Application")
    Set acadDoc = acadApp.ActiveDocument

    Dim cenpoint(0 To 2) As Double
   
    Dim circobj As Object

   cenpoint(0) = x1: cenpoint(1) = y1: cenpoint(2) = z1
    Set circobj = acadDoc.ModelSpace.addcircle(cenpoint, rad)
    acadApp.ZoomExtents
    
    End Sub
    
    
    Sub addpoly(cords, col)
    
    Dim acadApp As Object
    Dim acadDoc As Object
    Set acadApp = GetObject(, "AutoCAD.Application")
    Set acadDoc = acadApp.ActiveDocument

    Dim oPline As Object
    
' add pline to Modelspace
Set oPline = acadDoc.ModelSpace.AddLightWeightPolyline(cords)
oPline.Color = col

End Sub
   
    Sub alan1()
    
   
' This example adds a line in model space
' Define the start and end points for the line
   
    px1 = 1
    px2 = 5
    py1 = 1
    py2 = 5
    pz1 = 0
    pz2 = 0
    

Call addline(px1, py1, pz1, px2, py2, pz2)

End Sub

 Sub alan2()
 
    px1 = 1
    py1 = 1
    pz1 = 0
    Radius = 8.5
 
 Call addcirc(px1, py1, pz1, Radius)

 End Sub
 
 Sub alan3()
 'Dim coords(0 To n) As Double
 Dim coords(0 To 5) As Double
 coords(0) = -6: coords(1) = 1:
 coords(2) = 3: coords(3) = 5:
 coords(4) = 7.55: coords(5) = 6.25:
 
 col = 1
    
 Call addpoly(coords, col)

 End Sub

 

Edited by BIGAL

Share this post


Link to post
Share on other sites
Sambuddy

This is yet another great tip - Thanks BIGAL.

I know you are the king of LISP but about VBA: Do you think there is way to incorporate POLAR coordinates instead of Cartesian.

Example: @100<60

 

Thanks again

Share this post


Link to post
Share on other sites
BIGAL

In lisp (setq newpt (polar pt angle distance) ) do a google 

Set acadApp = GetObject(, "AutoCAD.Application") 'get reference to AutoCAD 
Set acadDoc = acadApp.ActiveDocument 'get reference to Drawing 
Set acadUtil = acadDoc.Utility
Dim acadUtil As Object
Dim pt2 As Variant 
Dim angle As Variant
pt2 = acadUtil.PolarPoint(pt1v, angle, (Height - t2 - t2) / 2)

S

Edited by BIGAL

Share this post


Link to post
Share on other sites
Sambuddy

Nice!

 

Thank you again BIGAL. I have not yet used it but I will soon I am sure of it

giphy.gif

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...