Jump to content

Search the Community

Showing results for tags 'ssget filter'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • CADTutor
    • News, Announcements & FAQ
    • Feedback
  • AutoCAD
    • AutoCAD Beginners' Area
    • AutoCAD 2D Drafting, Object Properties & Interface
    • AutoCAD Drawing Management & Output
    • AutoCAD 3D Modelling & Rendering
    • AutoCAD Vertical Products
    • AutoCAD LT
    • CAD Management
    • AutoCAD Bugs, Error Messages & Quirks
    • AutoCAD General
    • AutoCAD Blogs
  • AutoCAD Customization
    • The CUI, Hatches, Linetypes, Scripts & Macros
    • AutoLISP, Visual LISP & DCL
    • .NET, ObjectARX & VBA
    • Application Beta Testing
    • Application Archive
  • Other Autodesk Products
    • Autodesk 3ds Max
    • Autodesk Revit
    • Autodesk Inventor
    • Autodesk Software General
  • Other CAD Products
    • BricsCAD
    • SketchUp
    • Rhino
    • SolidWorks
    • MicroStation
    • Design Software
    • Catch All
  • Resources
    • Tutorials & Tips'n'Tricks
    • AutoCAD Museum
    • Blocks, Images, Models & Materials
    • Useful Links
  • Community
    • Introduce Yourself
    • Showcase
    • Work In Progress
    • Jobs & Training
    • Chat
    • Competitions

Categories

  • Programs and Scripts
  • 2D AutoCAD Blocks
  • 3D AutoCAD Blocks
  • Images
    • Backgrounds

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Found 6 results

  1. I've attached two drawings, each containing almost identical blocks named REVBLK. In one case, the test function below finds the block. In the other case, it does not. Why? Some context - I modified our REVBLK a few weeks ago, condensing the attributes so the revision block will fit in a smaller space. My lisp routine to update the title block can no longer locate the revised REVBLK. (defun _TestFunction ( / ) (setq rbname "REVBLK") (setq ss (ssget "_X" (list (cons 2 rbname)))) (if ss (princ "testfunction found revblk") (princ "no revblks found") ) ) blockfound.dwg noblockfound.dwg
  2. Can someone help me to find the solution for some doubts. If someone will make one lisp for this, so I think I will get answer for few doubts I need to draw a pline inside this 4 line using line point like this My doubts 1 how to get “line point” with window selection (4 line all pints not in window only 4 line 4 point) (setq p1 (getpoint "\nSelect object...")) (setq p2 (getcorner p1)) (setq mp (polar p1 (angle p1 p2) (/ (distance p1 p2) 2))) (setq p1 (list (nth 0 p1) (nth 1 p1))) (setq p2 (list (nth 0 p2) (nth 1 p2))) (if (not (equal '(nil nil) (sssetfirst nil (ssget "_C" p1 p2 '((0 . "LINE")))))) (setq lines (ssget "_:L"))) (if (/= (sslength lines) 4) (alert "4 lines need to be selected") 2 how to segregate the entity (which one is first which one is last) 3 how to entmake pline
  3. Hello Everybody, this is my first post and I'd like to know a little bit more about the ssget command. I already searched the world wide web for various search keywords, but couldn't find references / lists, especially of the Associative codes and object types. I also read a lot of articles about that command, but most of them use these Associative codes: http://www.lee-mac.com/ssget.html https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2017/ENU/AutoCAD-AutoLISP/files/GUID-0F37CC5E-1559-4011-B8CF-A3BA0973B2C3-htm.html http://www.afralisp.net/autolisp/tutorials/selection-sets.php They Since I am a total newbie with AutoLISP please explain things easily. What I would like to do in the first place is selecting objects via LISP, since there seems to be no command line version of SELECT, QSELECT etc. and therefore I need: a list of "names" of object types that exist in AutoLISP (eg. TEXT, LINE, etc) all neccessary parameters for the ssget function Let's say I want to select a table in a drawing, how can this be done? What if there are more than one tables? Many thanks in advance
  4. Hi everyone, Please help me how to create 2 selection set (one of "MTEXT" and one of "DIMENSION") from this code I made. (setq ss3 (ssget ":L" '((0 . "MTEXT,DIMENSION")))) Thank you so much.
  5. Hey all, i'm trying to "catch" a line with ssget. I know the x-coordinate of either the start- or the endpoint of the line i'm looking for, but i can't be sure wether it's gonna be the start- or endpoint having that certain x-coordinate. Also i want to include a certain "fuzz" factor, because the drawing is not super-accurate, with some of the entities not residing exactly where they should, but being "off" by about 0.00001 units or some such. So originally i went with the crossing option of ssget (i.e. (ssget "_C" 'pt1 'pt2)), but that didn't quite work right because the crossing option is dependant on objects being visible in the drawing area at the time of calling ssget and i want to iteratively catch lines scattered all over my drawing. So then i thought I'll just use (ssget "X") and filter for my lines, so this a minimal working example of what i've come up with: (defun c:get_line_by_start_or_endpoint ( x tol /) (ssget "X" (list '(-4 . "<OR") '(-4 . "<AND") '(-4 . "<=,*,*") (list 10 (+ x tol) 0.0 0.0) '(-4 . ">=,*,*") (list 10 (- x tol) 0.0 0.0) '(-4 . ">AND") '(-4 . "<AND") '(-4 . "<=,*,*") (list 11 (+ x tol) 0.0 0.0) '(-4 . ">=,*,*") (list 11 (- x tol) 0.0 0.0) '(-4 . ">AND") '(-4 . ">OR") '(0 . "LINE") '(8 . "MyLayer"))) ) Because i don't know wether it's gonna be the start- or the endpoint having the x-coordinate i'm looking, i have to use the whole "<or <and >and <and >and >or"-construct. Well the thing is it didn't work and as far as i can tell the problem seems to be, that the combination of "<and ... >and" with the relational ">=,*,*" / "<=,*,*" operatos. I tried catching lines only by the starting point omitting the whole <or <and and> <and and> or> construct and only using <=,*,* >=,*,* and it's working just fine: (defun c:get_line_by_startpoint ( x tol /) (ssget "X" (list '(-4 . "<=,*,*") (list 10 (+ x tol) 0.0 0.0) '(-4 . ">=,*,*") (list 10 (- x tol) 0.0 0.0) '(0 . "LINE") '(8 . "MyLayer"))) ) The problem is i honestly can't tell beforehand wether it's gonna be the start- or the endpoint having the specific x-coordinate. And of course i could just ssget for startpoints and ssget for endpoints and then combine the two selectionsets, but at this point this has become somewhat a matter of principle for me, because there just has to be a way to combine the operators that i need and make it work. So has anybody experience with combining logical and relational operators in a ssget function and might be able to point me in the right direction? Is there something i am missing? Any help would be greatly appreciated!
  6. Can somebody elaborate a bit about this -4 code and filters with wildcards in a selection set and explain how it really works? I am using the following: (setq pt '(0 0 2.5)) (setq ss (ssget "C" pt pt (list (cons 0 "LINE") (cons -4 "=,=,*") (cons 10 pt)))) My intent is to pick a line that passes through point 'pt' and make a selection set with this one only regardless how many other are crossing behind this line (visually passing through the pt). If I use the following it gives me always nil eventhough my line passes through this point (pt). (setq ss (ssget "C" pt pt (list (cons 0 "LINE") (cons -4 "=,=,=") (cons 10 pt)))) Why is that?
×
×
  • Create New...