All Activity
- Today
-
nil joined the community
-
JohnTP joined the community
-
CadtutorVIP joined the community
-
palm1106 joined the community
-
mhupp started following Excel VBA: 7 Functions for dealing with feet & inches in Excel
-
Excel VBA: 7 Functions for dealing with feet & inches in Excel
mhupp replied to phuynh's topic in .NET, ObjectARX & VBA
The problem I had with lambda's is getting them into a new workbook when I needed them. This VBA code will load them with a click/call. just need to convert quotes to double quotes. Sub LoadLambda() ActiveWorkbook.Names.add Name:="todec", RefersToR1C1:="=LAMBDA(imperial,[to_cFactor],LET(cf,IF(ISOMITTED(to_cFactor),1,to_cFactor),si,IF(LEFT(imperial,1)=""-"",-1,1),IF(ISBLANK(imperial),""n/a"",IF(ISNUMBER(imperial),imperial*cf,LET(ft,IFERROR(ABS(VALUE(LEFT(imperial,(FIND(""'"",imperial)-1)))),0),in,TRIM(SUBSTITUTE(SUBSTITUTE(IFERROR(RIGHT(imperial,LEN(imperial)-FIND(""'"",imperial)),imperial),""-"",""""),"""""""","""")),IFERROR(si*(ft*12+VALUE(IF(ISERR(AND(FIND("" "",in),FIND(""/"",in))),IFERROR(VALUE(""0 ""&in),in),in)))*cf,""n/a""))))))" ActiveWorkbook.Names("todec").Comment = "Convert various imperial format feet-inches to decimal with optional argument convert to-factor [cFactor]" End Sub -
danellis started following Rooftop and walls - two questions
-
Rooftop and walls - two questions
danellis replied to katie.dim's topic in AutoCAD 3D Modelling & Rendering
What programme are you using, and what level of detail do you need to model to? If you're looking to produce construction-type drawings, then, as Remark said, you need to keep the tops of your walls flat but show other elements to achieve the junction. If you're using AutoCAD Architecture to produce less detailed/non-construction drawings, then it has a command to "extend wall to roof" (I think that's what it's called-try a right click on the wall) that will sort it for you. If you're using some other software, you'll have to investigate how that software works- hopefully your training material covers it, or google or someone here will. dJE -
Ufff… I see a lot has happened in this thread since my last visit I’ve been busy with a couple of very urgent matters, but I’m going to try to catch up again. The results achieved by Dexus are very good. It seems there’s not much left to improve. Maybe getting a simpler and faster code? Also, the problem of the “recodos/inlet/recess” is still there: as long as there isn’t a code that can compute a centerline for two margins, whether they have recodos/inlets/recesses or not, there will continue to be thousands of unsuccessful searches for this problem on the web. I think finding a solution for this is a good goal. I’ll try to focus my next piece of code in that direction.
-
hello every body , I created a CUIX file in AutoCAD and set images for the panel icons, but their images don’t load and a question mark appears. The image format is PNG even i chaned that images to .bmp format but result is same ! whats the solution? (that problem doesn't occurs in all version.)
-
I don’t have a lot of lisp routines to test with, only the ones I use to benchmark with, they work, except _VL-TIMES is missing I was able to compile and load Python, most of the simple scripts I tested seem to work, on the fence on whether or not publish anything. There’s some weirdness preventing me from running my unit tests.
-
Rooftop and walls - two questions
oddssatisfy replied to katie.dim's topic in AutoCAD 3D Modelling & Rendering
To make walls reach the roof at an angle, you need to use a sloped wall or roof tool, or adjust the wall heights and vertices so each segment follows the desired slope. The white lines between joined boxes are internal edges or seams; to remove them, merge vertices, weld edges, or delete internal edges, and make sure all surfaces have the same material with smooth shading enabled so the lines no longer appear. -
Thanks LRM i do admit the task has a lot of posts and probably skipped over the one about using TIN's.
-
I worked on a package some 30+ years ago using lisp in Intellicad and there was no real problems, a couple of idiosyncrasies, that we had to recode around. No VL at that time, so don't know about current version if VL is supported, perhaps Daniel you can test. Intellicad quotes "he LISP interpreter is an internal API and can even be combined with the macro recording language mentioned above." The Autocad macro is at best useless if you want to edit it any serious way, I would like to know what code is produced by Intellicad if you could look at that as well. I have said before that one cad program macro from many years ago produced VBA code, much like Excel. This a similar example of Intellicad lisp package.
-
@BIGAL that was the essence of my suggestion about 100 posts ago (October 22). The results rely to heavily on the relative distribution of vertices (quantity and spacing) between the two polylines.
-
Just thought what would using a TIN, only drawback was TIN needed a lot of editing before joining mid points of mesh or lines. It is close to the orange linework. White lines are just that where TIN's have been removed.
-
RuyC joined the community
-
Publish as PDF,Purge all and save as dxf binary 2007
BIGAL replied to pyou's topic in AutoLISP, Visual LISP & DCL
Have a look at (setq lays (layoutlist)) there is no Model in the list created saves a few if and buts. Can use also (setvar 'ctab "Model") so no Doc required. - Yesterday
-
Penn Foster Student Suffering with Oleson Village Map!!!
ReMark replied to AutoCad Student's topic in Student Project Questions
What aspect of the project are you having difficulty with specifically? -
CIVIL 3D - CONVERT POINT CLOUD INTO SURFACE
CyberAngel replied to Carlo Point Cloud's topic in Civil 3D & LDD
As BigAl points out, you'll need to create a surface. An alignment may be helpful in locating things. Contours may help to locate the problem areas. Are the point clouds large, that is, do they cover the whole road? Or are they small, clustered on the damaged places only? Your workflow will be different depending on how much detail you have, how large the problem areas are, and the types and amounts of information you're expected to generate. -
leonucadom joined the community
-
Penn Foster Student Suffering with Oleson Village Map!!!
Jarvis replied to AutoCad Student's topic in Student Project Questions
yes, sorry it is the Oleson village project. I am in need of assistance started to project but having a hard time completing. -
this is from the export command edit: I just realized I was playing with PE, and not PE-plus. I think the later has the 3d tools
-
I'll check it out. I'll still see what I can get from Map 3D if time permits.
-
Prices look good. What 3D outputs does it have?
-
This is totally cool! This is a custom entity github.com/CEXT-Dan/ArxTin I’m very surprised this event worked! And it’s fast! There were three missing functions acedGetCurrentSelectionSet – missing acdbSymUtil()->blockModelSpaceId(pDb) – returns null
-
Blanka joined the community
-
This is a test with wxArx, github.com/CEXT-Dan/WxArx Has a great looking palette, wxDialogs work fine.
-
Let’s setup IRX and see how it compares to ARX I setup an ENV path IRX14 that points to the SDK. I didn’t see any documentation on how to setup a project from scratch. But there is a wizard for visual studio. I’ve had done this before, basically, I brute force it. There is documentation for .NET and ODA stuff.
-
3d looks pretty good, I think the nav tool is pretty cool as its activated on mouse over, though it’s hard to see with some visual styles
-
Danielm103 started following CMS Intellicad 14 review
-
Always been a fan of CMS. I had meant to test out v14 back when it was released, I think I couldn’t find the SDK or something. Anyway, Let’s check it. Good looking interface, Ribbon, menu bar, and title bar. I don’t do drawings much, so I’m mainly going to test out the IRX API. I’ve opened a few good size drawings, it seems responsive, zooming and panning is plenty fast.
-
Nice test case @PGia, it did have some undesirable zigzags on those lines. I made some changes to the code to prevent this from happening. It should create a smooth line again!
-
@SLW210 This weekend i finished a LISP that does exactly what i need, since there doesnt seem te be a regular AutoCAD-Map3D function for this. This code collects all object data on a layer, creates a 'exportprofile' for this specific layer and export this to its own SHP File. Since all EPF files are created for an individual layer, each SHP only gets the assigned ObjectData instead of 'All' objectdata in the DWG. code is based on the Dutch NLCS Cad standard for layer detection versus points/lines/polygons. ;;; ------------------------------------------------------------ ;;; MAPEXP_OD_ALL.LSP ;;; Export each layer to its own SHP using -MAPEXPORT + per-layer EPF ;;; - One SHP per layer in a subfolder: ;;; <DWGNAME>_YYYYMMDD_HHMMSS under the DWG folder ;;; - Uses DWGTITLED: if DWG not saved, alert & abort ;;; - Geometry type controlled by layer name suffix: ;;; * -S -> Point ;;; * -G -> Line ;;; * -GV -> Polygon ;;; Layers without those suffixes fall back to first-entity detection. ;;; - Per-layer Object Data (OD) mapped via ExpressionFieldMappings ;;; - EPF filters by that layer (DoFilterByLayer=1 + LayerList) ;;; - Treats closed polylines as polygons ;;; - Temp EPF is deleted after export ;;; - If SHP already exists: Overwrite via default ENTER, Load Profile? = Y ;;; - SHP filename: all '.' in the *layer name* are changed to ',' in the output file ;;; ------------------------------------------------------------ (vl-load-com) ;;; Global export folder (set in c:MAPEXP_OD_ALL) (setq *mapexp-export-folder* nil) ;;; --- small helpers --- (defun mapexp-get-dwg-folder ( / p ) ;; Use DWGPREFIX; ensure it ends with a backslash (setq p (getvar "DWGPREFIX")) (if (and p (/= p "") (/= (substr p (strlen p) 1) "\\")) (setq p (strcat p "\\")) ) p ) (defun mapexp-pad2 (n) ;; Pad single digit to 2 chars (e.g. 7 -> "07") (if (< n 10) (strcat "0" (itoa n)) (itoa n)) ) (defun mapexp-get-datetime ( / s lst ) ;; Get current date/time using EDTIME (compatible across versions) ;; Returns list: (year month day hour minute second) ;; %Y = year, %m = month, %d = day, %H = hour, %M = minute, %S = second ;; EDTIME format here: "YYYY MM DD HH MM SS" (setq s (menucmd "M=$(edtime,$(getvar,DATE),YYYY MM DD HH MM SS)")) ;; s is like "2025 11 21 14 32 05" ;; Turn it into "(2025 11 21 14 32 05)" and READ it (setq lst (read (strcat "(" s ")"))) lst ) (defun mapexp-get-export-folder ( / base path dt year mon day hh mm ss folder ) ;; Create export folder: ;; <DWGNAME_without_ext>_YYYYMMDD_HHMMSS ;; in the same folder as the DWG (setq path (getvar "DWGPREFIX")) (setq base (vl-filename-base (getvar "DWGNAME"))) ;; Use EDTIME-based datetime function (setq dt (mapexp-get-datetime)) (setq year (itoa (nth 0 dt))) (setq mon (mapexp-pad2 (nth 1 dt))) (setq day (mapexp-pad2 (nth 2 dt))) (setq hh (mapexp-pad2 (nth 3 dt))) (setq mm (mapexp-pad2 (nth 4 dt))) (setq ss (mapexp-pad2 (nth 5 dt))) (setq folder (strcat path "SHP_OD_EXPORT_" base "_" year mon day "_" hh mm ss "\\") ) ;; Create folder if it doesn't exist yet (if (not (vl-file-directory-p folder)) (vl-mkdir folder) ) folder ) (defun mapexp-sanitize-filename ( name / bad i ch ) ;; Replace characters that are invalid in file names (setq bad (list 34 42 47 58 60 62 63 92 124)) ; " * / : < > ? \ | (setq i 0) (while (< i (strlen name)) (setq ch (ascii (substr name (1+ i) 1))) (if (member ch bad) (setq name (strcat (substr name 1 i) "_" (substr name (+ i 2)) ) ) (setq i (1+ i)) ) ) name ) ;;; For the OUTPUT FILE NAME ONLY: ;;; - change '.' to ',' in the layer name ;;; - then sanitize for filesystem (quotes, *, /, :, <, >, ?, \, |) (defun mapexp-make-output-name (lay / s) (setq s lay) ;; Replace all dots with commas (setq s (vl-string-subst "," "." s)) ;; Remove OS-invalid characters but keep spaces, dashes, commas, etc. (setq s (mapexp-sanitize-filename s)) s ) (defun mapexp-first-entity-on-layer ( lay / ss ent ) (setq ss (ssget "X" (list (cons 8 lay)))) (if (and ss (> (sslength ss) 0)) (ssname ss 0) nil ) ) ;;; Fallback geometry detection – if no suffix rule hit (defun mapexp-geometry-type-from-entity ( ent / ed typ flags ) ;; Returns one of "Point" "Line" "Polygon" or nil (setq ed (entget ent)) (setq typ (cdr (assoc 0 ed))) (cond ((member typ '("POINT" "MULTILEADER" "INSERT")) "Point") ((member typ '("LINE" "ARC" "CIRCLE")) "Line") ((member typ '("LWPOLYLINE" "POLYLINE")) (setq flags (cdr (assoc 70 ed))) (if (and flags (= (logand flags 1) 1)) "Polygon" "Line" ) ) ((member typ '("SPLINE")) "Line") ((member typ '("HATCH" "POLYGON")) "Polygon") (T nil) ) ) ;;; Geometry type forced by layer name suffix (defun mapexp-geomtype-from-layername ( lay / ) ;; rules: ;; * -GV -> Polygon ;; * -S -> Point ;; * -G -> Line (cond ((wcmatch lay "*-GV") "Polygon") ((wcmatch lay "*-S") "Point") ((wcmatch lay "*-G") "Line") (T nil) ) ) ;;; Sanitize a string to be a valid FDO property name: ;;; - Only A–Z, a–z, 0–9, _ ;;; - If first char is not a letter or _, prefix with "F_" (defun mapexp-sanitize-fdo-name (s / i ch result) (if (not s) (setq s "FDO_NAME")) (setq result "") (setq i 1) (while (<= i (strlen s)) (setq ch (substr s i 1)) (if (wcmatch ch "[A-Za-z0-9_]") (setq result (strcat result ch)) (setq result (strcat result "_")) ) (setq i (1+ i)) ) ;; make sure first char is letter or _ (if (or (= result "") (not (wcmatch (substr result 1 1) "[A-Za-z_]")) ) (setq result (strcat "F_" result)) ) result ) ;;; Get unique OD table names used on a given layer (defun mapexp-get-od-tables-on-layer (layname / ss i e odtabs tbls tabName) (setq tbls '()) (setq ss (ssget "X" (list (cons 8 layname)))) ; all ents on layer (if ss (progn (setq i 0) (while (< i (sslength ss)) (setq e (ssname ss i) odtabs (ade_odgettables e) ; Map 3D ADE function ) (foreach tabName odtabs (if (and tabName (not (member tabName tbls))) (setq tbls (cons tabName tbls)) ) ) (setq i (1+ i)) ) ) ) (reverse tbls) ) ;;; --- EPF writer: SHP + OD + layer filter --- (defun mapexp-write-epf-with-od ( epfpath geomType layName odTabs / file tabName def_tbl cols col colName colType dataType usedNames outName baseName idx ) ;; geomType must be "Point" "Line" or "Polygon" (setq file (open epfpath "W")) (if (null file) nil (progn ;; Header – based on working AdMapExportProfile structure for SHP (princ "<AdMapExportProfile version=\"2.1.3\">" file) (princ "<LoadedProfileName/>" file) (princ "<StorageOptions>" file) (princ "<StorageType>FileOneEntityType</StorageType>" file) (princ "<GeometryType>" file) (princ geomType file) (princ "</GeometryType><FilePrefix/></StorageOptions>" file) ;; Auto-selection; filter by layer below (princ "<SelectionOptions><UseSelectionSet>0</UseSelectionSet><UseAutoSelection>1</UseAutoSelection></SelectionOptions>" file) (princ "<TranslationOptions>" file) ;; treat closed polylines as polygons (princ "<TreatClosedPolylinesAsPolygons>1</TreatClosedPolylinesAsPolygons>" file) (princ "<ExplodeBlocks>1</ExplodeBlocks>" file) (princ "<LayersToLevels><MapLayersToLevels>0</MapLayersToLevels><LayerToLevelMapping/></LayersToLevels>" file) (princ "</TranslationOptions>" file) (princ "<TopologyOptions><GroupComplexPolygons>0</GroupComplexPolygons><TopologyName/></TopologyOptions>" file) ;; Filter by this layer only (princ "<LayerOptions>" file) (princ "<DoFilterByLayer>1</DoFilterByLayer>" file) (princ "<LayerList>" file) (princ layName file) (princ "</LayerList>" file) (princ "</LayerOptions>" file) (princ "<FeatureClassOptions><DoFilterByFeatureClass>0</DoFilterByFeatureClass><FeatureClassList/></FeatureClassOptions>" file) ;; TableDataType "None" – OD via ExpressionFieldMappings (princ "<TableDataOptions>" file) (princ "<TableDataType>None</TableDataType>" file) (princ "<Name/>" file) (princ "<SQLKeyOnly>0</SQLKeyOnly>" file) (princ "</TableDataOptions>" file) (princ "<CoordSysOptions><DoCoordinateConversion>0</DoCoordinateConversion><CoordSysName/></CoordSysOptions>" file) ;; SHP target (princ "<TargetNameOptions><FormatName>SHP</FormatName></TargetNameOptions>" file) (princ "<DriverOptions/>" file) (princ "<UseUniqueKeyField>0</UseUniqueKeyField><UseUniqueKeyFieldName>AdMapKey</UseUniqueKeyFieldName>" file) ;; ===== OD ExpressionFieldMappings ===== (princ "<ExpressionFieldMappings>" file) (setq usedNames '()) ; track used attribute names to avoid duplicates (foreach tabName odTabs (setq def_tbl (ade_odtabledefn tabName)) ;; ADE table definition ;; def_tbl: (("TableName" . "...") ("Description" . "...") ("Columns" . ( ... ))) (setq cols (cdr (assoc "Columns" def_tbl))) (foreach col cols (setq colName (cdr (assoc "ColName" col))) (setq colType (cdr (assoc "ColType" col))) (if colName (progn ;; Map OD type to EPF Datatype (setq dataType (cond ((and colType (wcmatch (strcase colType) "*INT*")) "IntegerDataType" ) ((and colType (wcmatch (strcase colType) "*REAL*,*DOUBLE*,*FLOAT*,*NUM*")) "DoubleDataType" ) (T "CharacterDataType") ) ) ;; Decide attribute (FDO property) name: ;; - sanitize to valid FDO name ;; - if duplicate, append 2,3,... (setq baseName (mapexp-sanitize-fdo-name colName)) (setq outName baseName idx 1 ) (while (member (strcase outName) usedNames) (setq idx (1+ idx)) (setq outName (strcat baseName (itoa idx))) ) (setq usedNames (cons (strcase outName) usedNames)) ;; <NameValuePair> mapping: ;; <Name>outName</Name> -> FDO-safe property name ;; <Value>:ColName@Table</Value> -> actual OD mapping ;; <Datatype>...</Datatype> (princ "<NameValuePair><Name>" file) (princ outName file) (princ "</Name><Value>:" file) (princ colName file) (princ "@" file) (princ tabName file) (princ "</Value><Datatype>" file) (princ dataType file) (princ "</Datatype></NameValuePair>" file) ) ) ) ) (princ "</ExpressionFieldMappings>" file) (princ "</AdMapExportProfile>" file) (close file) T ) ) ) ;;; --- main export per layer --- (defun mapexp-export-layer-to-shp ( lay / ent geomType dwgFolder shpName shpFull epfFull odTabs ok ) ;; Prefer explicit geometry from layer name; fall back to entity if not matched (setq geomType (mapexp-geomtype-from-layername lay)) (if (null geomType) (progn (setq ent (mapexp-first-entity-on-layer lay)) (if (null ent) (setq geomType nil) (setq geomType (mapexp-geometry-type-from-entity ent)) ) ) ) (if (null geomType) nil (progn ;; Use the global export folder instead of the DWG folder (setq dwgFolder *mapexp-export-folder*) ;; SHP base name: layer name, but '.' -> ',' and OS-invalid chars cleaned (setq shpName (mapexp-make-output-name lay)) (setq shpFull (strcat dwgFolder shpName ".shp")) (setq epfFull (strcat dwgFolder shpName "_temp_export.epf")) ;; OD tables used on this layer (setq odTabs (mapexp-get-od-tables-on-layer lay)) ;; EPF for this geometry type + layer OD + layer filter (setq ok (mapexp-write-epf-with-od epfFull geomType lay odTabs)) (if ok (progn ;; If SHP already exists, we expect Overwrite prompt: ;; This file already exists. Enter an option [Overwrite/Cancel] <Overwrite>: ;; -> we send "" (ENTER) to accept default Overwrite ;; Then: Load Profile? [Yes/No] <No>: -> we send "Y" (princ "\n") (if (findfile shpFull) (command "-MAPEXPORT" "SHP" shpFull "" ; Overwrite? -> ENTER = default Overwrite "Y" ; Load Profile? Yes epfFull "Proceed" ) (command "-MAPEXPORT" "SHP" shpFull "Y" ; Load Profile? Yes (no overwrite prompt) epfFull "Proceed" ) ) ;; Delete temp EPF (if (findfile epfFull) (vl-file-delete epfFull) ) T ) nil ) ) ) ) ;;; --- public command --- (defun c:MAPEXP_OD_ALL ( / lay rec ) (vl-load-com) ;; Check if drawing is saved (if (= (getvar "DWGTITLED") 0) (progn (alert "Deze tekening is nog niet opgeslagen.\n\nSla de DWG eerst op en start MAPEXP_OD_ALL daarna opnieuw." ) (princ) ) (progn (setvar "CMDECHO" 0) ;; Create export folder for this run (setq *mapexp-export-folder* (mapexp-get-export-folder)) (prompt (strcat "\nMAPEXP_OD_ALL – exportfolder: " *mapexp-export-folder* ) ) ;; loop through all layers in the table (setq rec (tblnext "LAYER" T)) (while rec (setq lay (cdr (assoc 2 rec))) ; layer name ;; skip xref layers (contain "|") (if (not (wcmatch lay "*|*")) (mapexp-export-layer-to-shp lay) ) (setq rec (tblnext "LAYER")) ) (setvar "CMDECHO" 1) (prompt "\nMAPEXP_OD_ALL – done.") (princ) ) ) )
-
Is There a Reliable WordPad Online Alternative for Quick Editing?
oddssatisfy replied to oddssatisfy's topic in Autodesk Software General
thanks in advance for any help
