Jump to content

Search the Community

Showing results for tags 'programming'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • 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


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

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...

Found 10 results

  1. CyberAngel

    Code for labeling swales

    One of our most tedious and common tasks is labeling swales. You draw a polyline, you add a few elevation markers based on the design surface, and that's about it. So it would be nice if we could write a program for that. Plus it would be nice if it's easy to maintain. According to my research, though, that's a tall order. The only languages that let you drill that deep into Civil 3D have to allow .NET or COM, and that means you have to install Visual Studio. I'd rather not do that just to create and maintain one app. Does anyone know of a way to access Civil 3D surfaces and create elevation labels using AutoLISP or some other interpreted language? Python, maybe? Not asking for code, just a more suitable way to write it.
  2. I would like to merge the lisps I show at the end into one, where the process is first ADDID.lsp and then OD2ATT.lsp If it were possible with your help to add a new functionality to addid.lsp and that is that when you copy the block name in the TIPO_SENAL field of the Object Data You can check the block name to be able to change it to another, with some examples it would be enough to add as many times as this operation is necessary. thank you very much, greetings .... (defun c:ADDID (/ n inc enam idd efn) (setq tn "SDM_SEN_SENALIZACION") (prompt "Seleccionar señales") (princ) (setq n (getint "\n Ingrese valor de Inicio: ") ss (ssget '((0 . "insert"))) ) (setq inc 0) (repeat (setq len (sslength ss)) (setq enam (ssname ss inc)) (setq idd (itoa n)) (setq efn(vla-get-effectivename(vlax-ename->vla-object enam))) (ade_odaddrecord enam tn) (ade_odsetfield enam tn "INTERNO_SENAL" 0 n) (ade_odsetfield enam tn "TIPO_SENAL" 0 efn) (command "chprop" enam "" "c" "ByLAyer" "") (setq inc (1+ inc) n (1+ n) ) ) (alert "The entities selected with INTERNO_SENAL were updated") (princ) ) .... (defun c:OD2ATT (/ ss) (vl-load-com) (if (setq ss (ssget '((0 . "INSERT") (2 . "`*U*")))) ((lambda (i / e s od r v n d tag) (while (setq e (ssname ss (setq i (1+ i)))) ;; Extract object data (setq b (ade_odgetfield e (setq od (car (ade_odgettables e))) "INTERNO_SENAL" 0)) ;; Populate attributes (if (and (setq n (vla-get-effectivename (setq v (vlax-ename->vla-object e)))) (setq d (vla-item (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))) n))) (foreach attrib (vlax-invoke v 'getattributes) (vlax-for item d (if (= (vla-get-objectname item) "AcDbAttributeDefinition") (if (= (vla-get-tagstring attrib) (vla-get-tagstring item)) (cond ((= "INTERNO" (setq tag (vla-get-tagstring item))) (vla-put-textstring attrib b)))))))) )) -1)) (princ)) ADDID.lsp OD2ATT.lsp eg.dwg
  3. Hi, I have recently come up with an idea for a project. And to execute that idea i need to be able to read trough a DWG and perform calculations based on the dimensions of walls, windows, doors and stuff like that. Is there anyway i can save a dwg of a floor plan in some kind of text format so i can write a program that is able to read trough it and identify those elements and perform calculations based on those dimensions? Thank You.
  4. Hi, Is there a way to generate rectangles based of the information on table. Example: Each row of would table have length, width and name information. CAD should be able to read these values and generate corresponding rectangles on the model space. Thank you, Nixon
  5. jbaum

    I logic Bunk!

    So... I am trying to get an ilogic assembly to function properly I have the condenser working exactly the way I want it to. The Oil separator on the other hand, following the same path as the condenser mind you, will change according to the parameters, but then immediately reverts back to the original size. Annoying! Or I thought I could attach the files, didn't work so the following are the codes i am using. Any help or ideas are helpful since look at something for 5 Hours and not see why one part works, and the other does not is completely vexing! This first code is for the Oil Seperator does not work If Charge_Req >= 3.0 lbforce And Charge_Req Parameter("Oil Separatoripart:1", "Dia_Inlet") = 0.375 in Parameter("Oil Separatoripart:1", "Dia_Outlet") = 0.375 in Parameter("Oil Separatoripart:1", "Diameter") = 3.5 in Parameter("Oil Separatoripart:1", "Height") = 8.0 in Else If Charge_Req > 6.0 lbforce And Charge_Req Parameter("Oil Separatoripart:1", "Dia_Inlet") = 0.5 in Parameter("Oil Separatoripart:1", "Dia_Outlet") = 0.5 in Parameter("Oil Separatoripart:1", "Diameter") = 4.5 in Parameter("Oil Separatoripart:1", "Height") = 10.0 in Else If Charge_Req > 9.0 lbforce And Charge_Req Parameter("Oil Separatoripart:1", "Dia_Inlet") = 0.75 in Parameter("Oil Separatoripart:1", "Dia_Outlet") = 0.75 in Parameter("Oil Separatoripart:1", "Diameter") = 5.5 in Parameter("Oil Separatoripart:1", "Height") = 14.0 in End If InventorVb.DocumentUpdate() This code is for the Condenser and works fine If gpm >= 0.5 gal And gpm Parameter("Condenser_Wateripart:1", "Dia_Pipe") = 1.0 in Parameter("Condenser_Wateripart:1", "R_Coil") = 4.0 in Parameter("Condenser_Wateripart:1", "Rotation") = 2.53 in Else If gpm > 1.5 gal And gpm Parameter("Condenser_Wateripart:1", "Dia_Pipe") = 1.1 in Parameter("Condenser_Wateripart:1", "R_Coil") = 4.5 in Parameter("Condenser_Wateripart:1", "Rotation") = 2.78 in Else If gpm > 3 gal And gpm Parameter("Condenser_Wateripart:1", "Dia_Pipe") = 1.2 in Parameter("Condenser_Wateripart:1", "R_Coil") = 5 in Parameter("Condenser_Wateripart:1", "Rotation") = 3.03 in End If InventorVb.DocumentUpdate() iLogicVb.RunRule("OIL SEP SIZE") iLogicVb.RunRule("Warning") InventorVb.DocumentUpdate()
  6. ILoveMadoka

    Solidworks Macros - 2 Part Question

    1) Are there any SW API Power Users Here? That could help modify macro code? 2) Are there any sites that anyone can recommend similar to CADTUTOR specific to solidworks (More specifically Macro programming/editing) I find a lot of blogs but not a lot of interactive type sites.. I know there are some experienced SW users here but I am trying to learn more about Macro creation/modification. Here is an example: I have multiple details in a SW drawing that each have "Detail X" on one line and "Scale 1:2" on the second line. I have to make the "Detail" text one size, the "X" another size and the "Scale 1:2" text a third size. (Not my idea! ) I recorded a macro highlighting each text portion and changing the text size but when I run the macro on a new piece of text, it changes the entire text item to each size in turn. These labels are identical so it seems easy enough but not sure if a macro can do something of this nature in a single step. Any help, links, etc is greatly appreciated!!
  7. A company in Iran employs people with Visual Lisp (Auto Lisp) programming knowledge and abilities. The advantages of this job depends on employee qualifications. Qualified persons please reply to this thread to receive more information. Thanks. Mohammad
  8. I need to update the tag, prompt, value tab in the current block attribute. I can change the tag and the value tab but not the prompt. Any help will be appreciated. The approach am taking is; AcDbDatabase *dwgDb; AcDbBlockTable *pBlockTbl; AcDbBlockTableRecord *pModelSpaceTblRcd; AcDbBlockTableRecordIterator *pModelSpaceItr; AcDbEntity *pEntity; AcDbBlockReference *pBlockRef; AcDbAttribute *pAttribute; AcDbObjectIterator *pAttrItr; AcDbObject *pObject; TCHAR tagBuffer[sINGLE_LINE_INPUT_LENGTH_SHORT]; // Prepare attribute location measurements AcDbObjectId idOfEntity; dwgDb = NULL; dwgDb = acdbHostApplicationServices()->workingDatabase(); if (dwgDb == NULL) { AfxMessageBox(_T("Internal Error !")); return false; } dwgDb->getSymbolTable(pBlockTbl, AcDb::kForWrite); pBlockTbl->getAt(ACDB_MODEL_SPACE, pModelSpaceTblRcd, AcDb::kForWrite); pBlockTbl->close(); // Get an iterator to that we can iterate / pinpoint // the desired entity via the objectID pModelSpaceTblRcd->newIterator(pModelSpaceItr); // Go to the block reference / objectID if(pModelSpaceItr->seek(thePANBLKBlockId) != Acad::eOk) { AfxMessageBox(_T("Internal Error !")); delete pModelSpaceItr; pModelSpaceTblRcd->close(); return false; } // Access the block reference pModelSpaceItr->getEntity(pEntity, AcDb::kForWrite); pBlockRef = AcDbBlockReference::cast(pEntity); // Prepare iterator to move through block's attributes pAttrItr = pBlockRef->attributeIterator(); for(pAttrItr->start(); !pAttrItr->done(); pAttrItr->step()) { acdbOpenAcDbObject(pObject, pAttrItr->objectId(), AcDb::kForWrite); pAttribute = AcDbAttribute::cast(pObject); _tcscpy_s(tagBuffer, SINGLE_LINE_INPUT_LENGTH_SHORT, pAttribute->tag()); pAttribute->upgradeOpen(); // LEFTBFHGT if(_tcscmp(tagBuffer, _T("LEFTBFHGT")) == 0 || _tcscmp(tagBuffer, _T("LEFTHEIGHT")) == 0 ) { TCHAR attrText[COMMENT_LENGTH_SHORT]; _tcscpy_s(attrText, COMMENT_LENGTH_SHORT, pAttribute->textString() ); AcDbAttributeDefinition *tempAttrDefinition = new AcDbAttributeDefinition(); tempAttrDefinition->setPosition(pAttribute->position() ); tempAttrDefinition->setTag(_T("LEFTFFHGHT")); tempAttrDefinition->setPrompt(_T("Left Front Face Height.")); tempAttrDefinition->setTextStyle(idTextStyleLeroy); tempAttrDefinition->setHeight(.32); tempAttrDefinition->setRotation(0); pAttribute->setAttributeFromBlock(tempAttrDefinition, pBlockRef->blockTransform() ); pAttribute->transformBy(pBlockRef->blockTransform() ); pAttribute->downgradeOpen(); pModelSpaceTblRcd->appendAcDbEntity(pEntity); pBlockTbl->upgradeOpen(); pModelSpaceTblRcd->upgradeOpen(); tempAttrDefinition->close(); } pAttribute->close(); } // Free the attribute iterator delete pAttrItr; pBlockRef->close(); delete pModelSpaceItr; pModelSpaceTblRcd->close();
  9. I am a sales rep for a manufactured steel product. I have done CAD drawings for 7 years, but we had a program/lisp/i don't know what you call it set up to make the drawings much easier and faster. I think I attached an example of my draftings, as you can see they are pretty simple. What I'm looking for is someone that can. 1. Make an autoplot program that works w/ the Item 2 2. Make borders, that are scalable in Model space. (letter, ledger, Arch C, and Arch D) w/ my title block 3. Make a set scale function that changes all text types size automatically this should be linked in some way to the borders 4. Creates quick key/type commands for the following: a. line b. copy c. move d. normal text e. title sytle text f. dimensioning (leaders and horizontal/vertical) plottting organize a line weight color scale All my drawings are two dimensional. Please note i am a salesmen and don't know understand CAD tech speak. DWR-OLYMPIC_n_HILL_PRELIM-WALL-PLAN_Rev-1-LADBS.pdf
  10. tigger29900

    Layer Properties using VBA

    Newbie here i have been using this forum frequently as of late and had a question i was hoping you could help me with. I am building a program in visual basic to select certain layers and change their color to outline a certain path on a layer diagram. I need to program a clear button that sets all of the layer colors back to color 7 as efficiently as possible any help would be appreciated Secondly and less important I was trying to figure out a way to select all of the text in the selected layers and export them to excel to build an effected equipment list. )I'm not sure if this is even possible) Any help would be greatly appreciated
  • Create New...