Jump to content

Search the Community

Showing results for tags 'variable'.

  • 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. hey guys, I am hoping someone can tell me what is wrong with my cad. I have been fiddling around with the autopublish to generate PDF and it seems somehow a variable or something was made incorrect. As a result, each time I publish say PDF or hard copy, first page/ tab of any project appears blank. This seems to be consistant no matter if I change my page setup under publish to any predefined setting. (1st. page is always either blank or extremely small that appears as though it is blank). Any suggestions? Does anyone know what is wrong? Thanks
  2. Hey guys, I'm looking to assign a custom property to a variable and I have no idea how to do it. In the 0 custom prop I put a testvalue Here is the code I have so far: (vl-load-com) (defun c:test (/) (setq acadObject (vlax-get-Acad-Object) acadDocument (vla-get-Activedocument acadObject) ;; set existing custom properties to dProps dProps (vlax-get-property acadDocument 'Summaryinfo) ) ;; get the value at the specifed index in the dProps and assign it to location (vla-GetCustomByIndex dProps 0 "IMPCSVLOC" location) ) I can't find any documentation on the "vla-GetCustomByIndex" so I don't really know how to use tbh. I've attached a file that has the custom property setup. All insight and help is appreciated. Thanks, JT testfile.dwg
  3. Does anyone have any information on DraftSight and the use of lisps and setting variables, these are two separate questions. I currently can load a lisp and run them as I do in AutoCad but there are limitations/variations to certain things. Does anyone have a comparison or know the differences with the two programs? My next question is about setting variables in DraftSight, Command Line: (setq no1 10) returns 10, but when I invoke !no1 it returns Error: No Function. as if the value got wiped immediately after being set. Is there a System Variable I need to set to hold these variables or is it just not possible in DraftSight? Any information is much appreciated.
  4. So, here's the problem. I have been working on a lisp routine since July, and am rapidly approaching the finish line. At this point, I'm trying to make small improvements to make the program easier to use. My last major hurdle is dealing with the local variables that are erased whenever a file is closed. I'm trying to create a block that will be inserted at the end of each iteration of the lisp routine. When inserted, the block will fill roughly a dozen individual attributes. The idea is that when the lisp routine is run it will: 1.) Look for this block. 2.) Read the attribute values contained in the block. 3.) Set a group of variables to the values of the attributes. While I have seen many sites and threads devoted to setting attributes to a variable, I have not seen any that go in the reverse order (provided that the attributes actually have a value, of course). Any thoughts, suggestions? I sincerely doubt that anyone wants to thumb through 100 pages of text, but I do have a small file to practice with, if anyone is curious.
  5. Is it possible using AutoLISP to define a variable name from the command line when running a function? I want to input the name when running it from the command line. Can I do this and still have the variable be global? If so, how would I go about that? Thanks in advance.
  6. Hi, this is my first post on the forum & I'm also pretty new to AutoCAD scripts & Lisp routines, so please bear with me. Basically I have the following script: (setq dn (strcat (getvar "dwgprefix") "New Drawing.dwg")) (vl-propagate 'dn) _.saveas 2010 !dn This script saves my current drawing as 'New Drawing.dwg' within my current directory, and works fine. When I try to modify the script to the following, which attempts to open instead instead of save, it doesn't work, just prompts for drawing name: - (setq dn (strcat (getvar "dwgprefix") "New Drawing.dwg")) (vl-propagate 'dn) _.open !dn The saveas & open dialogues look very similar, so please could someone explain why I can reference a variable for the _.saveas filename, but not for the _.open filename, or have I got the syntax completely wrong for the _.open command?
  7. Hopefully I have created the thread in the right place. I was wondering if there is any system/environment variable to disable accessing online content? (I need to disable this feature via my lisp code)
  8. Hi all, Some how the variable for saving the dwg file has changed. So, when I save a dwg, I get the prompt for me to type in the file name. Anyone know by chance what the setting is to change it back? Many thanks
  9. Can a AutoLISP command be written to read an attribute in a block and draw a circle with the attribute as the diameter using variables? The appilcation is taking the diameter of a tree trunk (the attribute), multipling by 12, and drawing the canopy circle on hundreds of those blocks. So the circles drawn will vary in size. Not sure how this could be set up, i'm NOT familiar with LISP writing AT ALL. 1) Read block, single, mulitple or definition? 2) Read Attribute 3) Varaible of attribute, (attribute is an inch measurement...it needs to be multipled by 12 to get feet for final use as circle diameter drawn) 4) Draw circle, variable, with diameter coming from attribute variable (attribute in inches that is multipled by 12) 5) Center point or circle to be block's base point Thanks everyone, always such great help here!
  10. Hey Guys, Ive got this routine which is intended to erase everything visible which is of a colour determined by the user. (defun c:ec () (setq ecc (getint "\nEnter COLOUR of objects to ERASE : ")) (setq CODE 62) (setq pt1 '( -50000000000000 -50000000000000 -50000000000000)) (setq pt2 '( 50000000000000 50000000000000 50000000000000)) (setq ssec (ssget "w" pt1 pt2 '(list (cons CODE ecc)))) (command "ERASE" ssec "") ) The plan is to only ERASE objects which are visible at the time. So the routine should not operate on any objects on hidden layers... but should operate on objects off the screen (visible in viewport but cannot be seen due to zoom/pan position... if you follow). The problem I am having is I am finding it difficult to pass the colour variable (ecc) to the SSGET filter list while using the "W" option. If I replace "W" with the "X" option.. the routine works, but it will operate on everything in the database. So... I was just wondering if someone could please advise me of a way to filter the "W" optioned SSGET with a variable defined by the user? Thanks so much for any help. ----------EDIT--------- The problem with using the "W" option and defining the co-ordinates as I have is that it is dependant on my current UCS. I have since amended the routine to work around this issue. Please see below. (defun c:ec () (setq ecc (getint "\nEnter COLOUR of objects to ERASE : ")) (setq CODE 62) (command "ucsicon" "off" "ucs" "view") (setq pt1 '( -50000000000000 -50000000000000 -50000000000000)) (setq pt2 '( 50000000000000 50000000000000 50000000000000)) (setq ssec (ssget "w" pt1 pt2 '(list (cons CODE ecc)))) (command "ERASE" ssec "") (command "ucs" "p" "ucsicon" "on") ) Thanks guys.
  11. Hi, the problem I was facing (and still facing) was that I use my mouse middle button (scroll) as pan when clicked, But it poped out menu for snap overrides, then I resolved this issue by MBUTTONPAN variable by setting its value to 1. Now when I start a new file or a new session it reverts back to snap override menu and I have to again use variable. The changes I am making are not lasting more then a drawing. Can any one tell me what's causing this and how can I resolve this. Once I made a change in variable it should be permanent unit I change it again, but it is not. So does any one have any solutions. I have also tried profile for this case, but same results. Even the changes I have made to FILL or TASKBAR or ZOOMFACTOR and many like this which I am used to are not working more then a drawing. Would appreciate any one's expertise.
  12. niculaegeorge

    How does helix bias work?

    Max Help only says that at bias 1 the turns are forced to one side, at -1 to the other side and at 0 all the turns are evenly distributed. I need to know on what formula or calculation the bias is based. Basically I’m building a 1 turn helix radius1=radius2=15 height=123. Move it to world origin. Switch viewport to front. The center of this helix changes as the bias changes. :?Yeah, but how? Based on what relation? If you set bias to 0.5 the center of our turn is at x=-15 y=0 z=120.28208 which is extremely close to the top. How is this calculated? I want the center of my turn set at z=92.25 which is at 75% of the entire helix height (half the distance between its center and top). According to this, bias should be set at 0.111111111. How is this determined? Is it a function of radius1 and 2, or of height? :unsure:My guess is that we are dealing with a ratio with an exponential factor based on its parameters. I want this formula. How is the bias affected if the two radii are different? My input values are segment AB and segment AC along with basic helix parameters. From these I want to determine/calculate the bias value. Expressed in other terms, how do I get from 0.75 to 0.11111 ? Can anybody tell what is under the hood of helix bias? Autodesk 3dsMax 2013 64-bit version 15 product update 6 Acer aspire V3-571G-53214G50Makk, Ivy Bridge Core i5-3210M @ 2.5GHz(turbo boost 3.1GHz), Nvidia GeForce GT 630M (2GB VRAM), 8 GB RAM DDR3 1333MHz, Win 7 Ultimate 64-bit
  13. Hi, I have a question about if it is possible to set a block's dimensions to read a table's cell value. Say a rectangle has dimensions x wide by y tall and a table has the x and y values given in cells a1 and b1 linked from an excel spreadsheet. I would like to link it like this because i have an excel file that will update and then output to AutoCAD. Is this possible and if so how? I have figured out how to link the excel table into AutoCAD. I am using AutoCAD 2012 if that helps. Thanks, Barry
  14. dirkvandonkelaar

    Variable in DXF code

    Hi all, I have a problem with my list, according to the code below. (if (null (tblsearch "style" teksthoogte)) (entmake (list '(0 . "STYLE") '(-3 ;; Make the style annotative ("AcadAnnotative" (1000 . "AnnotativeData") (1002 . "{") (1070 . 1) (1070 . 1) (1002 . "}") ) ) '(100 . "AcDbSymbolTableRecord") '(100 . "AcDbTextStyleTableRecord") '(2 . teksthoogte) ;; Style name '(70 . 0) ;; Standard flag values (bit-coded values) '(40 . 1. ;; text height '(41 . 1.0) ;; width factor '(50 . 0.0) ;; oblique angle '(71 . 0) ;; text generation "0" normal text '(42 . 0) ;; last height used '(3 . "Arial.ttf") ;; font file name '(4 . "") ;; bigfont (blank for no) ) ;; end list ) ;; end entmake ) ;; end if When I run this LISP, AutoCAD says: ; error: bad DXF group: (2 . TEKSTHOOGTE) So, my question is: how can i get the variable "teksthoogte" working in this list?
  15. I've currently taken on the task of updating my organization's title blocks. I'm utilizing Fields in the title block in conjunction with system and sheet set manager variables. I've noticed in the Field Dialog Box there is a CreateDate field choice to display the date the file was created. My question is, is there - or is it possible to create - a system variable that is capable of retrieving the Windows login name of the user who created the file? There are multiple workstations at my organization and former users capable of creating AutoCAD files. I would like to be able to retrieve their Windows login name (eg. jwhitens) of the user who created the file to display as the "Drawn By" field in my title block. Any help would be greatly appreciated. Thanks!
  16. Hey everyone. Im having a bit of trouble constructing a string. I have my code working perfectly except for one little thing. I want the middle part of my string to be a variable, set by the user earlier in the code, or reading another USER variable. Here is my code so far: (defun C:titld (/ strRevv ) ;' (vl-load-com) (SETQ RV (GETVAR "USERI5")) (IF (= RV 0)(setVAR "USERI5" (getint "\nEnter Current Revision Number: "))) (setq pt (getpoint "\Select Insertion Point: ")) (setq strRevv (getvar "useri5")) (setq date (strcat "%<[url="file://acsm/"]\\AcSm[/url] SheetSet.REV " "04" " DATE [url="file://f/"]\\f[/url] \"%tc1\">%")) (setq desc (strcat "%<[url="file://acsm/"]\\AcSm[/url] SheetSet.REV " "04" " DESCRIPTION [url="file://f/"]\\f[/url] \"%tc1\">%")) (setq initial (strcat "%<[url="file://acsm/"]\\AcSm[/url] SheetSet.REV " "04" " INITIALS [url="file://f/"]\\f[/url] \"%tc1\">%")) ;(setq date (strcat "rev " strrevv " INITIALS")) (COMMAND "-insert" "rev1t40-d" pt "" "" "" strrevv date desc initial)() ) Notice in each of the date, desc, initial lines there is the "04". What i would like to be able to do is use the value stored in the strRevv variable and make the string out of that number. Is this even possible? Thanks in advance for your time!
×
×
  • Create New...