YZ Posted November 24, 2015 Share Posted November 24, 2015 I'm prototyping a faster way to tabulate window heights on survey diagrams. We measure tops and bottoms of windows, but then show them in plan view. Our drafties currently type the heights into a table. It occurred to me that there might be a way to pick the text objects (which contain the heights) one at a time and paste each value into the next row of a table. Anyone got inspiration for where i could start with this? I'm looking for a non lisp solutions. Quote Link to comment Share on other sites More sharing options...
steven-g Posted November 24, 2015 Share Posted November 24, 2015 Can you post an example, of the window drawing with text and a populated table, it always helps to see a problem, for example is it text, mtext or attributes. Quote Link to comment Share on other sites More sharing options...
YZ Posted November 25, 2015 Author Share Posted November 25, 2015 Thanks for the response steven. I know it's a long shot. Here's some more info. The orange text are all single line text objects. The lower numbers represent the elevation of the window sill, while the higher number represent the elevation of the window head. And I have to type them in to a table like this: I already have a macro that stamps each window with an incrementing number when I go through and pick each window. Sample drawing is attached. WindowTables.dwg Quote Link to comment Share on other sites More sharing options...
BIGAL Posted November 26, 2015 Share Posted November 26, 2015 I know Steven is a wiz with LT but as per your PM if you had say Briscad you could do this so easy using just a block rather than a table pick window number pick text the "schedule" is updated, we do this for drainage pit schedules it matches the 1st id to the 1st attribute so it knows which block to populate the schedule can live anywhere in the drawing. As per image the info comes from about 4 different parts of the dwg. Quote Link to comment Share on other sites More sharing options...
YZ Posted November 26, 2015 Author Share Posted November 26, 2015 Interesting. How does it know how many rows to have in the block? For example, what if you have more pits than normal? Can the process add rows? And do you use lisp to activate this? Thanks for the ideas Bigal. Quote Link to comment Share on other sites More sharing options...
steven-g Posted November 26, 2015 Share Posted November 26, 2015 My first responce, would be to suggest a block as Bigal has said (not sure about the link with Briscad ?). It should be possible to create a block that automatically increments a number as it is inserted and then fill in attribute values rather than using text, so it wouldn't read the existing text, it is an alternative method of working. The block information is easily changed, and can be read out to a csv file and imported into excel, from there it can be read back into Autocad as a table. Without LISP or similar programming options, those of us with LT are limited to finding different methods of working so it would be doubtful that you could get it to be a single button solution. My next question is, seeing your drawing there are 2 values for the sill level (which do you choose for the table) How often do you need to create drawings like this - if it is all day, everyday, then there are certainly alternative options to save time (but they would take a while to setup, so not feasible for occasional use) If this is a process that is often used, it would be helpful to know the actual process that you use now. How is the survey data collected, who enters it into the drawing, how it is entered etc. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted November 26, 2015 Share Posted November 26, 2015 YZ its not that hard you have 1 block but inserted mutiple times into a plain linetype grid to look like a table so as many lines as you like, you have 1 attribute with a unique value in the example its the pit number, this is picked first in the code its a block or text, yes a bit of manual copy or edit pit number but if you look at the schedule there is like 15 columns of input and this info is not all in one place. The add next line is one of those things I need to do. The code supports text so in your case "Window-23" is ok. Post a simple dwg I appreciate you only have LT but as you mentioned maybe a upgrade so why not to a Autocad alternative that supports lisp. Again 1 task 20 minutes now around 10 seconds you work out the dollars you save. Public Sub ModifyPitSchedule2() ' puts in 1 pt x and y's plus length and width Dim SS As AcadSelectionSet Dim objENT As AcadEntity Dim Count, Cntr As Integer Dim Newpitname As String Dim pitname As String Dim FilterDXFCode(0) As Integer Dim FilterDXFVal(0) As Variant Dim PitNameSelect As AcadObject Dim basepnt, pt1, pt2, pt3 As Variant Dim attribs As Variant On Error Resume Next Newpitname = "1" 'dummy to pass then return changed pitname = Getpitname(Newpitname) MsgBox "pitname selected is " & pitname basepnt = ThisDrawing.Utility.GetPoint(, " Pick PIT center ") ptxtx1 = CStr(FormatNumber(basepnt(0), 3)) ptxty1 = CStr(FormatNumber(basepnt(1), 3)) pt1 = ThisDrawing.Utility.GetPoint(, " Pick 1st point ") pt2 = ThisDrawing.Utility.GetPoint(, " pick 2nd point L ") pt3 = ThisDrawing.Utility.GetPoint(, " pick 3rd point W ") lx = Abs((pt1(0) - pt2(0))) ly = Abs((pt1(1) - pt2(1))) lz = Int((lx ^ 2 + ly ^ 2) ^ 0.5 * 10000) / 10 lengthpit = CStr(FormatNumber(lz, 0)) lx = Abs((pt2(0) - pt3(0))) ly = Abs((pt2(1) - pt3(1))) lz = Int((lx ^ 2 + ly ^ 2) ^ 0.5 * 10000) / 10 widthpit = CStr(FormatNumber(lz, 0)) 'This will clear out old selectionsets, and prevent the "selection set already exists" error If ThisDrawing.SelectionSets.Count > 1 Then For Cntr = 0 To ThisDrawing.SelectionSets.Count - 1 ThisDrawing.SelectionSets.Item(Cntr).Delete Next Cntr End If FilterDXFCode(0) = 0 FilterDXFVal(0) = "INSERT" Set SS = ThisDrawing.SelectionSets.Add("pit2sel") SS.Select acSelectionSetAll, , , FilterDXFCode, FilterDXFVal BLOCK_NAME = "SCHEDTEXT" For Cntr = 0 To SS.Count - 1 If SS.Item(Cntr).Name = BLOCK_NAME Then attribs = SS.Item(Cntr).GetAttributes If attribs(0).TextString = pitname Then attribs(1).TextString = ptxtx1 attribs(2).TextString = ptxty1 attribs(5).TextString = lengthpit attribs(6).TextString = widthpit attribs(1).Update attribs(2).Update attribs(5).Update attribs(6).Update Cntr = SS.Count End If End If Next Cntr ThisDrawing.SelectionSets.Item("pit2sel").Delete End Sub Function Getpitname(Newpitname As String) As String Dim PitNameSelect As AcadObject Dim pitattribs As Variant ThisDrawing.Utility.GetEntity PitNameSelect, basepnt, "pick pit name : " If PitNameSelect.ObjectName = "AcDbText" Then Getpitname = PitNameSelect.TextString End If If PitNameSelect.ObjectName = "AcDbBlockReference" Then pitblname = PitNameSelect.Name ' RETURNS BLOCK NAME pitattribs = PitNameSelect.GetAttributes Getpitname = pitattribs(0).TextString End If End Function Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.