Jump to content

Search the Community

Showing results for tags 'divide'.



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 16 results

  1. Hi all: I like using Lisps, but don't know how to write code for them. I like this particular lisp created by Mosad Elewa and posted on Cadalyst.com. When trying the lisp on a polyline, it did not work. Seems to only work on a "line". Here's the code: ---------------------------------------------------------------------------------------------------- ;;;CADALYST 02/07 Tip 2180: DIV.LSP Modify Divide © 2007 Mosad Elewa ;DIV.LSP BY MOSAD H. ELEWA (1996) (defun C:DIV () (setq ent (entget (car (entsel "\nSelect object to divide")))) (setq etype (cdr (assoc 0 ent))) (if (eq etype "LINE") (progn (cond ( (setq m (getint "\nNumber of segments")) (setq pt1 (cdr (assoc 10 ent))) (setq pt2 (cdr (assoc 11 ent))) (setq ang (angle pt1 pt2)) (setq dist (distance pt1 pt2)) (setq dd (/ dist m)) (setq pt3 (polar pt1 ang dd)) (setq ang2 (+ ang 1.5708)) (setq pt4 (polar pt3 ang2 (/ dd 4))) (setq ds (distance pt1 pt3)) (command "line" pt3 pt4 "") (setq pt5 (polar pt3 ang2 (/ dd )) (command "move" "l" "" pt4 pt5) (setq d 0) ; (setvar "cmdecho" 0) (command "copy" "l" "" "m" pt1) (repeat (- m 2) (command (polar pt1 ang (setq d (+ d ds))))) (command ""))) )) (if (eq etype "ARC") (progn (setq n (getint "\Number of segments")) (setq ang (cdr (assoc 50 ent))) (setq ang2 (cdr (assoc 51 ent))) (setq ang3 (- ang2 ang)) (setq ang4 (/ (* ang3 180.0) pi)) (setq cp (cdr (assoc 10 ent))) (setq r (cdr (assoc 40 ent))) (setq pt1 (polar cp ang r)) (setq pt2 (polar cp ang (/ r 4))) (setq pt3 (polar cp ang (/ r )) (command "line" cp pt2 "") (command "move" "l" "" pt3 pt1) (command "array" "l" "" "p" cp (+ n 1) ang4 "y") )) (if (eq etype "CIRCLE") (progn (setq n (getint "\Number of segments")) (setq cp (cdr (assoc 10 ent))) (setq r (cdr (assoc 40 ent))) (setq pt1 (polar cp 0 r)) (setq pt2 (polar cp 0 (/ r 4))) (setq pt3 (polar cp 0 (/ r )) (command "line" cp pt2 "") (command "move" "l" "" pt3 pt1) (command "array" "l" "" "p" cp n "360" "y") )) (princ) )[/CODE] -----------------------------------------------------------------------------------------------------
  2. i want to modified "area" command. see below picture. Click the first point. Click the second point. Click to third point, moving the mouse pointer along the line, the green part of the area, showing the edit is a must.
  3. how to divide a polygon into 3 equal polygons (same area or we known area)? I wanted to divide the polygon shown in the screenshot below into equal 3 polygons (with same area), but I couldn't figure out if these is some commands or workflow to perform this issue is the "trial and error" is the only technique by which this issue can be done? thank you in advance, regards malkasun
  4. Hello I would like to have a simple lisp routine that divide all the numbers in a given layer by 20, can anybody help me? Thx
  5. Hello, I'm using a function to quickly divide a line. The divisions are rounded to a chosen distance. (defun inzetpunten (/ obj num div objg) (while (not obj) (setq obj(entsel)) (if obj (progn (setq objg (entget (car obj))) (setq num (/ (distance (cdr (assoc 10 objg)) (cdr (assoc 11 objg))) 400)) ; target distance = 400 (if (< 0.5 (- num (fix num))) (setq div (1+ (fix num))) (setq div (fix num))) (if (> 2 div) (setq div 2)) (command "divide" obj div) ) (princ "\nNothing was selected, Please select a line!")) ) (princ) ) Now this works great. But I have a drawing with the same length lines, only one divides into 6 and the other divides into 7 parts. I got a vlax dump of the 2 lines: Select object: ; IAcadLine: AutoCAD Line Interface ; Property values: ; Angle (RO) = 3.14159 ; Application (RO) = #<VLA-OBJECT IAcadApplication 000000013fd89110> [color=red]; Delta (RO) = (-3000.0 9.09495e-013 0.0)[/color] ; Document (RO) = #<VLA-OBJECT IAcadDocument 000000002f573368> ; EndPoint = (-14065.0 5567.73 0.0) ; EntityTransparency = "ByLayer" ; Handle (RO) = "DB11" ; HasExtensionDictionary (RO) = 0 ; Hyperlinks (RO) = #<VLA-OBJECT IAcadHyperlinks 0000000037a10f78> ; Layer = "HULPLIJN" ; Length (RO) = 3000.0 ; Linetype = "ByLayer" ; LinetypeScale = 1.0 ; Lineweight = -1 ; Material = "ByLayer" ; Normal = (0.0 0.0 1.0) ; ObjectID (RO) = 44 ; ObjectName (RO) = "AcDbLine" ; OwnerID (RO) = 43 ; PlotStyleName = "ByLayer" ; StartPoint = (-11065.0 5567.73 0.0) ; Thickness = 0.0 ; TrueColor = #<VLA-OBJECT IAcadAcCmColor 0000000037a13370> ; Visible = -1 T ; Property values: ; Angle (RO) = 3.14159 ; Application (RO) = #<VLA-OBJECT IAcadApplication 000000013fd89110> [color=red]; Delta (RO) = (-3000.0 0.0 0.0)[/color] ; Document (RO) = #<VLA-OBJECT IAcadDocument 000000002f573368> ; EndPoint = (-14065.0 5685.33 0.0) ; EntityTransparency = "ByLayer" ; Handle (RO) = "DB3C" ; HasExtensionDictionary (RO) = 0 ; Hyperlinks (RO) = #<VLA-OBJECT IAcadHyperlinks 0000000037a13078> ; Layer = "HULPLIJN" ; Length (RO) = 3000.0 ; Linetype = "ByLayer" ; LinetypeScale = 1.0 ; Lineweight = -1 ; Material = "ByLayer" ; Normal = (0.0 0.0 1.0) ; ObjectID (RO) = 42 ; ObjectName (RO) = "AcDbLine" ; OwnerID (RO) = 43 ; PlotStyleName = "ByLayer" ; StartPoint = (-11065.0 5685.33 0.0) ; Thickness = 0.0 ; TrueColor = #<VLA-OBJECT IAcadAcCmColor 0000000037f29450> ; Visible = -1 T The only difference seems to be the delta, how can I work around this bug in my lisp? Thanks in advance!
  6. Models with different sizes (m² or ft²) and scales (1:50, 1:100, 1:200, etc.) are divided into different numbers of layouts. I have seen they are either put into a single layout or divided into several layouts. How do you know into how many layouts and at which points a model should be divided to print it out with the right scale and paper size? Thanks in advance.
  7. Hey, For a big height map that has height lines every 5m I would like to fake a more accurate map of one line per 1m. To do that manually it would take a crazy amount of time, so I was wondering if there is a way to do this quickly. I made this very elaborate image to show my point. In orange/yellow being the automatically generated lines (in my actual CAD file there will be 4 lines) I searched in the possibilities of array and divide, but haven't found this sort of in-between option yet. Does anybody know how I could do this or if there is already a command or plugin for this? Thanks!
  8. Hello, I know this is a user error on my part, Bu I cannot figure this out for the life of me. My company have a set of blocks in a .dwg file on its own - let's say they are circles with radii that vary by 10'. In another drawing I want to divide a polyline using a one of these circle blocks at a specified number of segments. My process is to copy that block from its original file into my new file with the polyline - now I am able to list the block when I go through the divide command. MY ISSUE is when I complete the command, my block, as it is distributed along the polyline, is 1/12th the scale of the actual block I copied into my drawing. (it's something with the 12 inches are in a foot deal). It's like the divide command scaled it down...I can't explain why though. Both of my block units (the original file block and the one produced by the divide command in my new drawing) are set to inches and both drawing files are set to arch. - inches. The weird thing is that when I copy the block over into my new drawing it is at the correct scale. It is just this block - when brought in through the divide command - is scaled by 1/12. Thanks in advance,
  9. Hello All, First off, Thanks for this site and everyone that posts on it....I have recieved a lot of great info just reading through forums. This routine arrays selected objects along an arc, spline, pline, helix, at offsets, rotations, etc... -edit- User selects object(s), basepoint of object(s), array path, starting end of path, option to rotate object(s) relative to path - at user defined angle, offset distance, and using Divide or Measure methods of spacing. For Measure option, last option is to place another object at end of path or not. -edit- code updated. Added Max Spacing option. Provide "max spacing" distance, and it calculates the maximum equal spacing between objects along the array path. array-path-2d.pdf array-path-3d.pdf ARRAY_PATHS.lsp
  10. I'm looking to use the measure command in a slightly different way. I need to use measure, then return that number created into a block and insert that block to a point on a line. Ultimately, I am creating a "stud count" for a beam 12" on center. Any ideas? Thanks, -Nobull
  11. I need to divide a bridge deck section (sort of trapezoidal shape with circular hollow section inside) but I need to keep the centroid level of each section to be at the same height. is there any simple way of doing it using Autocad 2014?
  12. Guys, I'm curious, somebody know how to use the commands: Measure or Divide. I need to distribute a block in one traced line, but with the same space betwen them, these commands put the distance, so, when the object that is the reference got a inclination the distance follow the object but the final distance has a litle mistake because degree of inclination... below I'm showing in some pictures what I'm trying to explain, someone knows one LISP code that can help? Thanks...
  13. Hello all! I am new to this forum, so please forgive me if I ask stupid questions or simply don't make sense My work requires me to create programs for our CNC router. It is done in AutoCAD 2008. To help making programs faster I've created series of dynamic blocks. I am attaching a file with one of those blocks. The file is actually illustrating what I need to do number of times a day. I would like to make the process even faster and more fool-proof. The "old way" in file shows what my current way of creating programs. The "new way" is my attempt to make it faster. My problem is automatically dividing a line in dynamic block into a variable number of segments that are always equal. Naturally I use divide command after I stretch and explode my dynamic block. It would be much faster if the block would be able to do it all by itself. My attempt of solving this was to use Visibility Parameter. However, if you look closely at it, you'll notice that if I want to do it for all the possible combinations it will be extremely complicated and easy to mess up. If only there was a way to have two visibility parameters. Then I'd make one for horizontal holes and another for vertical. Unfortunately I can't. Does anyone have an idea how to accomplish this? LISP, maybe? Unfortunately, I don't know LISP, although I'd love to learn. I'm a pretty fast learner (I've pretty much taught myself how to make dynamic blocks using only AutoCAD help file). So if you guys know a good guide to start learning LISP, let me know. Thanks in advance for all the help. Cheers! Auto hole spacing.dwg
  14. I want to divide a line to three equal parts and draw lines stating from divided points. Command "devide" neatly do the dividing job and put marks for points. Appearance of these makrsers could be altered by ddptype command to become more visible. However I can't snap to these points when I want to draw line using object snap. Aren't these points selectable?
  15. hi, i'm still a beginner in lisp and need some help from you guys; ;;;---- lets say i have a closed polyline outline (shape like a light bulb) that consist of lines and arc as my base entity. if i were to use "divide" say by "50 segments" (user input) on this polyline can this 50 nodes or more that has been created be use to trace the outline of the entity using "polyline" by lisp. i will then use this newly created closed polyline (all lines) to be the "wipeout" frame as we know that only close "polyline" (all lines) are accepted. i use acad (archi) 2009 (win xp) ;;;sequence summary ;;;-------------------------- ; prepares the base entity using polyline (lines, arc) before lisp initiation. ;(defun c:dw () ; short for divide-wipeout ;(setq oldpdmode (getvar "pdmode")) ;(setq p1 (entsel "\n select entity") ; selection set p1 ; ensure that the selection is a polyline otherwise alert the user and re-select. ;(command ".divide" p1 "ask user for input") ; divide command that will ask user on how many segment req. ; use the nodes/points that the ".divide" command created and begin "pline" command to trace those nodes and then close the pline. ; (command "wipeout" "p" entlast "y") ; deletes all the pdmode points ; (princ) exit cleanly ;;;-------------------------- thank you in advance
  16. stmoong

    Dividing a polyline

    Hi, I'm trying to divide up a closed polyline with the blue line that intersects with it. I'm able to get the vertices for the intersection points. The end result should have 2 separate closed polylines. I've checked on the internet, and found some Lisp code, which unfortunately, I do not know how to interpret Does anyone know how to go about it? I'm progamming in C# .Net. Thank you. Special cases I will need to work out later: 1) One of the intersection points are on a vertex. 2) Both intersection points are on different vertices. 3) Both intersection points are on the same axis, i.e. the blue line is on one of the edges.
×
×
  • Create New...