Search the Community
Showing results for tags 'arx'.
-
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();
-
I have few .arx applications for AutoCAD. In these applications few are menu based and others are command line. Now what I am trying to do is, Load the .arx app, run it and then unload it once the .arx application runs through a LISP command. .arx applications run once the user clicks on the tabs that are provided. .arx applications are written in VC++. Now I have a lisp file, which gets loaded once the user starts AutoCAD. In the lisp files I have declared these functions for various .arx applications; (defun c:XYZ_program() (command) (command) (arxload "C:/ABC/XYZ.arx") (command "XYZ_program") (arxunload "XYZ.arx") ) It works fine for Programs which need input data from Menu based forms, but says error unloading xyz.arx for programs which need command line input. I was wondering if there were any commands in LISP that will make sure arxunload "XYZ.arx" will execute only once (command "XYZ_program") is executed. I am not sure on how to approach this problem. Any help with the same would be greatly appreciated. I have also discussed this question with others in the following link, but did not find much of help. http://stackoverflow.com/questions/17602443/loading-and-unloading-the-arx-file-with-lisp You can have a look at it, just to gather some information, in which direction were we heading.
-
lsp help for loading & unloading arx file from specified folder!
jamesfui posted a topic in AutoLISP, Visual LISP & DCL
hi.. need help on creating lsp that can: > load & unload *.arx file which is located on specified folder! example; ``````` [size=2](defun c:arxload()[/size] [size=2](command "load" "[/size][size=2]c:\documents & settings\user\addons\mditab17.arx[/size][size=2]")(princ))[/size] [size=2](defun c:arxunload()[/size] [size=2](command "unload" "[/size][size=2]c:\documents & settings\user\addons\mditab17.arx[/size][size=2]")(princ))[/size] thanks -
I have been trying to figure this out for a couple of days now. The only thing I could find is this LISP that takes the Ellipse properties and uses them to creat an arc. When I use this, the start and end angles are not correct in the drawing. Ellipses must have been drawn in a different UCS). I have tried to get the LISP to use the start and end points of the ellipse along with the radius and center point. For the life of me I cannot figure it out. If anyone knows how to do this please let me know. *NOTE* Elllipses that I am trying to convert have the same minor and major radii. Thanks in advance!! (defun c:e2a (/ acaddoc acadms acadobj center endangle obj radius ss ssn startangle) (vl-load-com) (if (setq ss (ssget '((0 . "ellipse")))) (progn (setq acadobj (vlax-get-acad-object)) (setq acaddoc (vla-get-activeDocument acadobj)) (setq acadms (vla-get-modelspace acaddoc)) (setq ssn (ssname ss 0)) (setq obj (vlax-ename->vla-object ssn)) (if obj ;(equal (vla-get-RadiusRatio obj) 1 0.0001) (progn (setq radius (vla-get-MajorRadius obj)) (setq Startangle (vla-get-Startangle obj)) (setq Endangle (vla-get-Endangle obj)) (setq Center (vlax-get obj 'center)) (entdel ssn) (vla-addarc acadms (vlax-3d-point Center) radius Startangle Endangle) ) ; progn (alert "> Ellipse objects failed to be converted") ) ; if ) ; progn ) ; if (princ) ) ; defun