Jump to content

Search the Community

Showing results for tags 'coordinates'.



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

  1. Hello, thank you for taking the time to look at my post. And thank you all for creating such a useful body of knowledge for beginners like myself to learn from. I have been searching around for a lesson on using MText in AutoLISP (admittedly i have found a few amazing examples) Lee Mac has posted several replies to similar question. sorry for bringing it up again, but these have been over my head a bit. I am hopping someone will take the time to apply the MText solution to the attached Lisp that i currently do understand. It uses the Text Command...I realize using commands is amateurish, but I am still learning ; Northing & Easting labeling ; Ryan Anderson December 2013 ; The Label will use the current Text Style and current Units Settings ; This Lisp borrows ideas from the tutorials I have been working through. ; http://www.afralisp.net/ http://lee-mac.com/ http://www.cadtutor.net/ http://www.cad-notes.com/ (defun c:gln (/ p x y TxtPos) (command "_.MSPACE") (while (setq p (getpoint "Select a Northing Gridline:")) (command "_.PSPACE") (setq TxtPos (getpoint "Pick Label Location: ")) (setq y (rtos (cadr p))) (setq y (strcat "N " y)) (command "_TEXT" TxtPos "0" y "") ; I would prefer to use MText with a backbround mask and an offset ) (princ) ) (princ) (defun c:gle (/ p x y TxtPos) (command "_.MSPACE") (while (setq p (getpoint " Select an Easting Gridline:")) (command "_.PSPACE") (setq TxtPos (getpoint " Pick Label Location: ")) (setq x (rtos (car p))) (setq x (strcat "E " x)) (command "_TEXT" TxtPos "90" x "") ; I would prefer to use MText with a backbround mask and an offset ) (princ) ) (princ "Use GLN for Northings, and GLE for Eastings") ;Could both Northings and Eastings be done from one command? (princ) Cheers! and thanks again for your time. Andy.
  2. Hi everyone, I ran into a weird issue when I tried to create a rectangle off of a base point. Whenever I type in the x and y coordinates, a rectangle is created however the coordinate i typed in is now the end point and the rest of the rectangle extends to the bottom left of my screen and is beyond my zoom extent. I can create a rectangle using just the x coordinate off of a base point but it seems like the y coordinate is screwing everything up. Has anyone ran into this type of issue before? I was able to create rectangles all night using a base point but for some reason this issue just started happening to me. Thank you!!!
  3. I'm not a programmer. I'm looking for a function to extract from autocad all the coordinates of polyline vertex with autocad handle. I work with autocad map 2012 and 2013. Help in that regard would be appreciated.
  4. Hello I'm trying to make an ATTDEF (in combination with a circle/reference object) to show coordinates in meters, even though the drawing units are in mm. The general drawing units may not be changed. I want the output to be 7,453 rather than 7453. Yes, with comma and three decimals... But how ? Please help, Thank you. Sorry for my english
  5. Hi all I was wondering if anyone knows of a lisp code to hatch squares, i have a textfile with xyz coordinates and a color code, the coordinates are in the center of all the squares. what i would like is to hatch the squares with a specific color, defined in the text file. Can anyone help to make this. (theres a lot of squares that needs to colored) thanks in advance.
  6. Hi, I am having a little trouble with gps coordinates. I am trying to snap to a specific gps coordinate on my layout. I have a "gps block" that spits out the proper coordinates but i am not sure how to move to a specif point. My layout is set up such that when i use my "gps block" on a known point it spits out the northing and easting, however, when i try to actually type in a specif northing and easting, it is no where near the point i am looking for on the layout. Any help on this would be appreciated.
  7. Hi Guys, I'm fairly new to this 'lisp' program. I'm a trainee setting out engineer and have a question. How do I display both eastings and northings coordinates on one line? My senior engineer has it on his Auto CAD but got it done from somebody else and he doesn't know how to do it. See Image - Shows coordinates X and Y This is how it should be - Please note I typed them coordinates in myself Any help would be greatly appreciated Taj.
  8. Greetings. Is it possible, with a routine autolisp, read a txt file and enter each line type a comma separator in line position to be determined by routine? Specifically, I have a file of coordinates but no tab for it and wanted to enter their tabs, showing the position of each. Example of what I have: 5001100926.946000096.8278000221.264000NL 5001101025.256000096.9432000220.437800NE 5001101122.944000097.0376000219.154600NE 5001101222.372000096.9222000218.697200NM Example of what I want: 50011009,26.9460000,96.8278000,221.264000,NL 50011010,25.2560000,96.9432000,220.437800,NE 50011011,22.9440000,97.0376000,219.154600,NE 50011012,22.3720000,96.9222000,218.697200,NM I appreciate the help
  9. I hope I can explain this simply enough: I am drawing a diagram to describe a mathematical word problem. Since it is easier to visualize with a drawing, I want to draw it using the given dimensions. But angles used in the diagram are unknown and are not needed for the answer to be calculated, so the only way to draw this freehand is to guess at the angle resulting in the correct distances to be off. Here is the word problem: There are two ladders, one 40 feet and the other 30 feet, each touching the base of one of two buildings and leaning against the other building. If the ladders cross 10 feet above the ground, how far apart are the buildings? So for my drawing, being rather simple considering what AutoCAD can do, results in this: Can AutoCAD calculate the angle needed to place a line of a given length between two parallel lines that are a distance apart less than the length of the line to place between them, having the endpoints of this line touching the parallel lines, fitting exactly? For the word problem, the distance between the two parallel lines is what needs to be solved and the math is quite invloved, having to find the roots or solution of a quartic equation. (I have the solution figured out to be 26.03287754 feet) What I am afraid of is that this would require to program an AutoLISP routine to create a new command that one can call from the command line. I see it using the the measure command with relative and absolute co-ordinates. This may be far from a "beginner" question. I can do this quite easily on a peice of paper: having two parallel lines drawn, take a ruler and placing the "0" mark on one line, then adjusting the angle until the desired length just reaches the opposite parallel line. I used to use this trick quite often when drafting with pencil and paper to divide a distance into a required number of even amounts, so this can't be that difficult to do with AutoCAD! If anyone needs further details just let me know!
  10. I am using AutoCAD Civil 3D 2011. I am trying to import a shape file (contours) into a drawing that was given to me by a client. So I went into the Tool-Based Geospatial workspace, went insert>map import>selected my shape file and clicked ok. It inserted, but its in the wrong spot. I'm assuming this is because of different coordinate systems used when making the shape file vs. my drawing. Here's my dilemna. I right-clicked my drawing settings and it has no coordinate systems. I'm told that the shapefile was created with the NAD83 Zone 13 coordinate system. I'm wondering if there is a way I can get these to match up without messing up my drawing. I'm very new at this, and there may be a simple solution. Any suggestions?
  11. Hi All, As a preface... I'm new here. Now here is my question: a civil engineer sent us a .dwg file for a site survey. However, the .dwg contours are just showing up as a series of overlapping rectangles. He attached two .txt files, one for elevation point locations, the other for tree locations. Both give coordinates... i.e. :452,2718.7202,2509.7896,569.4979,GL etc. I know that the .txt file is giving locations, but I do not know how to generate plines etc. from the given coordinates in the .txt file. I downloaded ascponit.lsp, but i'm not sure if this is meant for this... I'm using AutoCAD 2008. Any recommendations? Thanks, LR
  12. AutoCAD help on "geographic location" says: Geographic location embeds location-specific references – expressed as real-world coordinates (X,Y, and Z) – in your drawing. In GL box, I only see input boxes for "latitude" and "longitude" with no boxes for x or y coordinate. Is it possible to calculate a drawing's coordinates with this command? As I search ed the help and this forum its main use is in rendering and sunlight calculation, but I am trying to search another function for it to calculate x, y coordinate of a drawing.
  13. Hello everyone, Haven't been on here in ages - coming back into the CAD fold again. Encountered a problem that I 'think' I've solved before but can't for the life of me work out 'how.. I have Dynamic block called say COORDwith Three attributes defined 1. Title 2. X Value 3. Y Value 1 is a text based attribute, 2&3 get the insertion point of the block and display. Works fine no bother.. But.. If i wblock all the COORDS and then xref back in - they all display the insertion point of the xref i.e 0,0. Has anyone any ideas how to solve this? Thanks Matt
  14. Hello! Long time lurker, first time asking a question... I am trying to select all of the text objects that reside beneath a block (I need to include the block too). The block can only be identified by having the attribute tag, "ADREM." My initial plan of attack is to locate the block based on the attribute tag and extract the coordinates (I'm having an issue with this), then select all the objects using the coordinates as an anchor. Thanks for all the help you guys have provided (unknowingly) thus far on other issues as well, this site is quite the resource. Take care, Seth
  15. Strange problem here in AutoCAD 2009: Inserting a block mainly made up of attributes (some text, no geometry) picking a point on screen (free point: no snap, no coordinate entry) attdia is set to 0 when entering through default values at the command line the block on screen seems to be offset from my pick point (offset seems to be relative to 0,0 also) if I go all the way through the block, no problems except it is kind of annoying to have the block not show up in the right place while going through the atts the first time bigger problem is if I escape during the att editing and then draw any geometry that same offset referred to earlier is apparent when drawing and my grips are now detached from my geometry!!!! a regen will fix the new geometry and line it back up with the grips but it shifts any existing geometry too!!! Pretty hard to explain actually, Been looking for a solution for a couple days now, best I can tell it is some kind of coordinate problem with my blocks? UCS, ECS? Sysvar? I've run an audit on my template and the block with no errors, tried making a fresh block with same characteristics, same problem. Help please! Thank you!
  16. I installed 2009 on a new computer (Windows 7 using remote XP mode). My drawing looks slightly tilted - the horizontal lines seem to jag. How do I fix this? Thx!!
  17. Ok. So I'm using a lisp routine that has been previously set up. It wouldn't display any of the current UCS coordinates. I think I fixed that. But now, I have caused a problem with the leaders. Specifically the line that is supposed to go underneath the N but above the easting. In WCS it works out just fine, but in the UCS it shoots off up and right. usually based on how far I am from the World Origin. Help! Below is the code. (Sadly I don't know exactly where the problem is) Main Function--------------------------------------------------------------------------- ;;;Function draws a leader with no text. (defun bmcdNE (wLeader wElev wa / ap np ep N E) (BMCDTextStyles) ;load standard text styles (BMCDDimStyles) ;load standard dim styles ;save variables (NEsave-vars) ; setup error handler here (setvar "cmdecho" 0) (setq *error* leader-error) ;check and set dscale (if (= dscale nil) (setq dscale (getvar "dimscale")) );end if (QlSave);saves current settings ;Now we need to set the current settings for the needed leader (setq NoText '(4 ;1. AnnoType 60 0Mtext<def> 1Copy 2Tolerance 3BlockReference 4None 0 ;2. ReuseAnno 61 0None<def> 1Next 2Current 1 ;3. LeftAttach 62 0TopOfTop 1MiddleOfTop<def> 2Middle 3MiddleOfBottom 4BottomOfBottom 3 ;4. RightAttach 63 0TopOfTop 1MiddleOfTop 2Middle 3MiddleOfBottom<def> 4BottomOfBottom 0 ;5. Underline 64 1On 0Off<def> 0 ;6. Splined 65 1On 0Off<def> 1 ;7. NoPointLimit 66 1On 0Off<def> 2 ;8. NumPoints 67 Integer (Must be greater than 2) 3<def> 0 ;9. Wordwrap 68 1On<def> 0Off 1 ;10. AlwaysLeftJust 69 1On 0Off<def> 0 ;11. Angle1 70 0Any<def> 1Horizontal 2?d 3Ed 40d 5 d 0 ;12. Angle2 71 0Any<def> 1Horizontal 2?d 3Ed 40d 5 d 0 ;13. Box 72 1On 0Off<def> 0.0 ;14. Textwidth 40 Real (Must be > 0.0) 0.0<def> "." ;15. Arrowname 3 String (or User defined arrow as block name) See definitions below ));end setq (command "osnap" "end,mid,intersection,center") (SetQleader NoText) (setvar "dimlwd" -1) (setvar "texteval" 1) (setvar "orthomode" 0) (setq style (cdr(assoc 40 (tblsearch "style" (getvar "textstyle"))))) ;gets the text height from style. (setq comp (cdr(assoc 41 (tblsearch "style" (getvar "textstyle"))))) ;stores the compression factor. (if (= 0 style) (setq ts (getvar "textsize"))) ;sets the text size to the active textsize. (if (/= 0 style) (setq ts style)) ;sets the text size to the style size. (command "layer" "set" "G-ANNO-TEXT" "") (setq pt1 (getpoint "\nEnter starting point:")) ;Gets the first point for the ;coordinate and line. (setvar "osmode" 0) (setvar "luprec" 2) (setq save-pt1 pt1) ;;; ;do we need to covert the point from pspace to mspace? (if (= (getvar "tilemode") 0) (setq cs_from 0) ;WCS (setq cs_to 1) ;UCS (setq pt1 (trans pt cs_from cs_to 0) ; disp = 0 indicateds that pt is a point ) (setq x1 (car pt1)) ;Stores the x coord of the first point. (setq y1 (cadr pt1)) ;Stores the y coord of the first point. (setq z1 (caddr pt1)) ;stores the z coord of the first point. JAH (setq xabs (abs x1)) ;Gets the absolute value of the x point. (setq yabs (abs y1)) ;Gets the absolute value of the y point. (setq zabs (abs z1)) ;Gets the absolute value of the z point. AMS (setq x (rtos xabs (getvar "lunits") (+(getvar "luprec")0))) ;Converts the x coord from real to string. (setq y (rtos yabs (getvar "lunits") (+(getvar "luprec")0))) ;Converts the y coord form real to string. (setq z (rtos zabs (getvar "lunits") (+(getvar "luprec")0))) ;Converts the z coord form real to string. JAH ;if the number of decimal places is less than the precission add zeros (while (< (strlen (substr x (+(vl-string-search "." x) 2))) (getvar "luprec")) (setq x (strcat x "0")) ) ;if the number of decimal places is less than the precission add zeros (while (< (strlen (substr y (+(vl-string-search "." y) 2))) (getvar "luprec")) (setq y (strcat y "0")) ) ;if the number of decimal places is less than the precission add zeros (while (< (strlen (substr z (+(vl-string-search "." z) 2))) (getvar "luprec")) (setq z (strcat z "0")) ) (setq IN x) ;Sets variable for subroutine. (COMMA) ;CALLS SUBROUTINE. (setq x OUT) ;Saves variable from subroutine. (setq IN y) ;Sets variable for subroutine. (COMMA) ;CALLS SUBROUTINE. (setq y OUT) ;Saves variable from subroutine. (setq IN z) ;Sets variable for subroutine. (COMMA) ;CALLS SUBROUTINE. (setq z OUT) ;Saves variable from subroutine. (setq pt1 save-pt1 ) (if (> X1 0) (setq E (strcat "E " x )) ;Checks to see if X coordinate ) (if(< X1 0) (setq E (strcat "W " x )) ;is positive or negitive ) (if(= X1 0) (setq E (strcat "BASELINE " x )) ;and sets the proper label. ) (if(> Y1 0) (setq N (strcat "N " y )) ;Checks to see if Y coordinate ) (if(< Y1 0) (setq N (strcat "S " y )) ;is positive or negitive ) (if(= Y1 0) (setq N (strcat "BASELINE " y )) ;and sets the proper label. ) (setq ABC "ABC ") ;;;build the elevation label (setq Zelev (strcat "EL " z)) (setq nl (strlen N)) ;Gets the string length of the N variable. (setq el (strlen E)) ;Gets the string length of the E variable. (cond ((> nl el) (setq ll nl)) ;Tests to see if the N var is longer than ;the E var. ((> el nl) (setq ll el)) ;Tests to see if the E var is longer than ;the N var. ((= nl el) (setq ll nl)) ;Tests to see if the N and E var are equil. ) ;end cond (setq pt2 (getpoint pt1 "\nEnter second point:")) ;The pt1 is used to create ;a rubberband line. (grdraw pt1 pt2 -1) ;Draws a tempory line to let you see ;where you are and what is going on. (setq x2 (car pt2)) ;Stores the Second X point (setq y2 (cadr pt2)) ;Stores the Second Y point (setq pt3 (getpoint pt2 "Enter side to offset:")) ;The pt2 is used to create ;a rubberband line. (setq x3 (car pt3)) ;Stores the Third X point (setq y3 (cadr pt3)) ;Stores the Third Y point (cond ((> x2 x3) (setq lx (- x2 (* 0.8 ts ll comp)))) ;Checks to see wich way ((> x3 x2) (setq lx (+ x2 (* 0.8 ts ll comp)))) ;you are drawing the line ) ;and sets the end of line ;to match the text length. (cond ((> x2 x3) (setq tx lx)) ;Based on the direction of the line ((> x3 x2) (setq tx (+ x2 ts))) ;the text X point is calculated. ) (setq ta (+ y2 (* ts 3))) (setq ap (list tx ta)) (setq tn (+ y2 ts)) ;Calculates the Y point for North or South text. (setq np (list tx tn)) ;Creates the point to place the text. (setq te (- y2 ts )) ;Calculates the Y point for East or West test. (setq ep (list tx te)) ;Creates the point to place the text. (setq tElev (- y2 (* ts 3))) ;Calculates the Y point for Elevation text. (setq elevP (list tx tElev)) ;Creates the point to place the text. (setq ly y2) ;Sets the last Y point EQ. to the second Y point. (setq pt4 (list lx ly)) ;Creates the point for the end of the line. (command "pline" pt2 pt4 "") ;Places the line. (setq theline (vlax-ename->vla-object (entlast))) ;get the line object (if (= style 0) (command "text" "J" "ML" np ts "0" N)) ;Places the top text. (if (/= style 0) (command "text" "J" "ML" np "0" N)) ;Places the top text. (setq toptext (vlax-ename->vla-object (entlast))) ;get the text object (if (= style 0) (command "text" "J" "ML" ep ts "0" E)) ;Places the bottom text. (if (/= style 0) (command "text" "J" "ML" ep "0" E)) ;Places the bottom text. (setq bottomtext (vlax-ename->vla-object (entlast))) ;get the text object (if wa (progn (if (= style 0) (command "text" "J" "ML" ap ts "0" ABC)) (if (/= style 0) (command "text" "J" "ML" ap "0" ABC)) (setq atext (vlax-ename->vla-object (entlast))) ) ) ;;;Create the text for the elevation text (if wElev (progn (if (= style 0) (command "text" "J" "ML" elevP ts "0" Zelev)) ;Places the bottom text. (if (/= style 0) (command "text" "J" "ML" elevP "0" Zelev)) ;Places the bottom text. (setq Elevtext (vlax-ename->vla-object (entlast))) ;get the text object );end progn );end if ;rotate the text and line to make it horizontal (setq viewrotation (getvar "viewtwist")) ;ucs twist (setq retval (vla-rotate theline (vlax-3d-point pt2) (* viewrotation -1))) (setq retval (vla-rotate toptext (vlax-3d-point pt2) (* viewrotation -1))) (setq retval (vla-rotate bottomtext (vlax-3d-point pt2) (* viewrotation -1))) (if wa (setq retval (vla-rotate atext (vlax-3d-point pt2) (* viewrotation -1))) ) (if wElev (setq retval (vla-rotate Elevtext (vlax-3d-point pt2) (* viewrotation -1))) );end if ;;;get the end point of the now rotated line this will also be the endpoint for the qleader (setq theLineCoords (vlax-variant-value (vla-get-Coordinates theline))) (setq newXPt (vlax-safearray-get-element theLineCoords 0)) (setq newYPt (vlax-safearray-get-element theLineCoords 0)) (setq newEndPt (list newXPt newYPt)) ;in order to avoid the the mtext dialog we set the default qleader settings above (setq ss (ssget "_X" (list (cons 0 "*MTEXT,TEXT")(cons 1 "Ex. TP*")))) (if wLeader (progn (vl-cmdf "qleader" pt1 pt2 newEndPt "") (vla-delete theline) ;delete our temp line );end progn );end if (Merge) (QlRestore) (setvar "cmdecho" 1) ;Turns on the command echo. (redraw) (NErestore-vars) (princ) );end defun (defun c:LNE () (bmcdNE T nil nil) (princ) );end defun (defun c:LNEL () (bmcdNE T nil T) (princ) );end defun (defun c:LNEEL () (bmcdNE T T T) (princ) );end defun (defun c:LNEE () (bmcdNE T T nil) (princ) );end defun (defun c:NEE () (bmcdNE nil T nil) (princ) );end defun (defun c:NEEL () (bmcdNE nil T T) (princ) );end defun (defun c:NEL () (bmcdNE nil nil T) (princ) );end defun (defun c:NE () (bmcdNE nil nil nil) (princ) );end defun I am using "lneel" as my command.
  18. Hi, I have a table with three columns: X, Y, LINK I'd like to populate a point layer from this table with points located at X and Y coordinates and the hyperlink automatically filled from LINK column (this is a path to a external file different for any point). Table is in MSaccess but I can convert it in other formats or ascii text file. is that possible maybe with scripts or other tools? thank you very much in advance Mario
  19. Hi guys. I have written some code in VB for autocad and for the moment i am declaring the coordinates in xyz axis as following: Private Sub CreatePoints() SidePoints(0) = 400: SidePoints(1) = -105.25: SidePoints(2) = 215 SidePoints(3) = N( - 400: SidePoints(4) = -105.25: SidePoints(5) = 215 SidePoints(6) = 400: SidePoints(7) = 0: SidePoints( = 215 SidePoints(9) = N( - 400: SidePoints(10) = 0: SidePoints(11) = 215....... For example sidepoints(0),sidepoints(1),sidepoints(2) (x,y,z) are the coordinates for one point. It would be great if i could just write Sidepoints(400,105.25,215). Is there a simpler way to declare coordinates or that is the only method?
  20. Hi, i'm still a beginner in lisp and need some help. I want to use some algorithms to simplify a 2D polyline but I don't know how to store the coordinates of each vertex in a different variable. thank you in advance
×
×
  • Create New...