Search the Community
Showing results for tags 'count'.
-
Hi all, I have a script taken from here which I've tweaked to get the count. (defun C:XREFCNT (/ i x) (setq i 0) (vlax-for x (vla-get-blocks (vla-get-ActiveDocument (vlax-get-acad-object)) ) (if (eq (vla-get-IsXref x) :vlax-true) (setq i (1+ i)) ) ) i ) XREFCNT returns the number in the commandline. How do I then do an alert, the code below doesn't work. It errors with: error: bad argument type: fixnump: # (if XREFCNT > 0) (alert (strcat "Number of External Reference Drawings = " (itoa (strcat XREFCNT))) )
-
LSP for changing text inside dynamic block similar to Tcount
ryankevin15 posted a topic in AutoLISP, Visual LISP & DCL
...... -
Count Specific Block Name and Insert Block to Coords Depending on Block Count
kylaughlan posted a topic in AutoLISP, Visual LISP & DCL
Hi there, I'm looking for a Lisp routine that can count the number of one specific nested block (it will always have the same name) within a single layout, and then automatically insert the same block (which doesn't need to be nested) to differing coordinates depending on how many of that block there already is. I am having doubts to whether this would even be possible but I thought I would ask. Seeing as nested blocks can be counted through Lisp, I figured it might be possible. I've began to explore the world of Lisp and am using a few different routines currently. They work great but I am nowhere near at a stage where I can write a detailed Lisp routine myself. [using AutoCAD 2017 full version] Thanks guys, Kyle -
LISP File - Count number of blocks, calculate area within block
pholt posted a topic in AutoLISP, Visual LISP & DCL
Hi all, I'm hoping you can help. I require a lisp file that can count the number of blocks in a drawing and calculate the total area of say a polyline that is in each block and plot it in a table format? Can anyone point me in the right direction please? Thanks Peter- 3 replies
-
- lisp files
- count
-
(and 3 more)
Tagged with:
-
I have the following block where I have successfully inserted stretch action (no limits) and array action (limit 20). I need to display the array count number next to the block so that I don't have to count the aisles every time I have to use the action. Dynamic Array Count.dwg
- 3 replies
-
- dynamic blocks
- dynamic block
-
(and 3 more)
Tagged with:
-
Hi to all, Please someone knows if its possible to create a field on a text form that could count a number of texts inside a drawing?... Eg.: I have the word "L1" 10 times in a drawing, it's possible to create a field that show me how many L1 I have in this drawing? Count of L1 = [10]; the item 10 it's automatic updates.
-
Field for counting polylines
battman posted a topic in AutoCAD 2D Drafting, Object Properties & Interface
Does anyone know of a field expression or lisp routine that will allow me to display a count of the number of polylines on any specified layer? I would like the number displayed to be able to update as I add polylines to the layer, just as an area field expression would update on regen. Thanks very much -
Hello, all. I have a question concerning block counting. I have become familiar with the BCOUNT command, but I wanted to take it one step further for my particular application. What I have is several viewports within a drawing. Each viewport represents a particular floor of a building. Furthermore, within each floor are "loops" defined by colored, dashed lines in which there reside certain devices (blocks). Identical devices may exist within other loops on the same floor. Here's the question: Is there a way to count (and possibly export that data to a spreadsheet) the number of blocks that reside within each loop boundary? The boundaries are rarely simply rectangles. It's easy to count the number of blocks within a viewport, but I'm having trouble figuring out (if there even IS a way) how to count the number of blocks within my loop boundaries. **I should clarify and say that, when I say viewports, what I really mean is layouts. There is one viewport per layout/floor. Sorry if this caused any confusion or cringing. Thanks in advance. Beef
-
Wants to select the same block having exactly same dimensions?
tipu_sultane posted a topic in AutoCAD 2D Drafting, Object Properties & Interface
I got a some type of network and wants to count the block having the exactly same dimensions. This is because to make their division with respect to length. Example say there is total 27 number of blocks having the length 7 meter etc. But I am facing the problems, when I select the blocks, all have been selected. Find below the attached images of my method which I apply. I just first used the explode command then select the block select similar object and move to somewhere else. I need some help to solve this problem. I have used the command like list and area but I believe its time consuming and hope there is a simpler method to do this job. -
I am a little new to assigning attributes. My company had a block with two attibutes that I need to alter. When the block is inserted, it asks a quantity. The other attribute is titled location. I am told if needed, all these quantities can be totaled per drawing. It has a title of "location". Two things: Can someone explain how to replicate this action? And is there a way to show all properties of a field for an attribute? Thanks, Nobull
-
To anyone out there, I'm working on a project and I need to get a block count of a select number of blocks within model space broken down to the various visibility states . I've used some of the Lee-Mac.com .lsp's, which work awesome but what i'm looking for is a combination of the three .lsp files. To put it simply how can I add a breakdown of visibility states to the COUNT.LSP that can be found on Lee-Mac.com. Thanks in advance. cadtutor.net newbie
-
- lsp
- dynamic blocks
-
(and 2 more)
Tagged with:
-
Macro for custom property of total number of piercings in a part
klarson85 posted a topic in Autodesk Inventor
Hello, I have been trying to create a macro that would add a custom property to my sheet metal parts that would tell me the total number of piercings in the part (holes and punches). So far I have the punches to count correctly but I am having issues with the holes, as I am getting an error. Any ideas? Sub Piercings() 'Get the part doc and sheet metal component defn. No error handling: Dim oPartDocument As Inventor.PartDocument Set oPartDocument = ThisApplication.ActiveDocument Dim oSheetMetalComp As Inventor.SheetMetalComponentDefinition Set oSheetMetalComp = oPartDocument.ComponentDefinition 'Dim oHoles As Inventor.HoleTables 'Set oHoles = oPartDocument.ComponentDefinition 'Get the pierce count Dim iHoleCount As Integer 'iHoleCount = oHoles.Count Dim iPunchCount As Integer iPunchCount = oSheetMetalComp.FlatPattern.FlatPunchResults.Count Dim iPierceCount As Integer iPierceCount = iHoleCount + iPunchCount 'Get the custom property set Dim oCustomProps As Inventor.PropertySet Set oCustomProps = oPartDocument.PropertySets.Item("Inventor User Defined Properties") 'Define the name of the PIERCING count iproperty name: Dim sPiercePropName As String sPiercePropName = "PIERCINGS" 'See if we already have an iproperty for the PIERCING count Dim oPierceProp As Inventor.Property Dim oProp As Inventor.Property For Each oProp In oCustomProps If oProp.Name = sPiercePropName Then 'We already have an iproperty, we just need to write the new value Set oPierceProp = oProp oPierceProp.Value = iPierceCount Exit Sub End If Next oProp 'We don't have an iproperty, so we create it and set its value If oPierceProp Is Nothing Then Set oPierceProp = oCustomProps.Add(iPierceCount, sPiercePropName) End Sub -
dbConnect Query like: SQL SELECT COUNT(*), SUM(*) FROM GROUP BY
gnurob posted a topic in CAD Management
Having some fun with dbConnect... it appears pretty easy to gather information from a database and apply it to a DWG, however it doesn't seem possible to summarize that data (e.g. "how many of these objects are in drawing"). For example, if the database contained window information and several types of windows were used multiple times, it should be possible to link each window to the database and then query the drawing to determine the number of each, and total cost. Window Count Cost Total TypeA 5 $250 $1250 TypeB 7 $200 $1400 Failing that, if the database could be updated (actually, this would be much better) with a new record for each new object, the database could perform the summary (and many other useful things). However, its appears the "Link..." can only pick an existing record from the database. Both seem unavailable from what I've seen of the application and the documentation. Please tell me I'm wrong! :-) IMHO, its surprising that attribute definitions are capable of so much more. Filling tables, linking to Excel, etc., should be small time for a database connection. Thanks