Jump to content

All Activity

This stream auto-updates

  1. Today
  2. fuccaro

    Is this possible in Solidworks?

    I just started to do some VB in SolidWorks. So this is my first try: Option Explicit Dim swModel As SldWorks.ModelDoc2 Sub main() Dim aLine As SldWorks.SketchSegment Dim line As Object Set swModel = Application.SldWorks.ActiveDoc swModel.SketchManager.Insert3DSketch True 'tetrahedron side length Dim L As Double 'doh... number of segments Dim segs As Integer L = 10 segs = 22 Dim Xa, Ya, Za As Double 'point A is in the origin Xa = 0 Ya = 0 Za = 0 Dim Xb, Yb, Zb As Double 'point B is along Ox Xb = L Yb = 0 Zb = 0 Dim Xc, Yc, Zc As Double 'point C is in xOy plane Xc = L / 2# Yc = L * Sqrt(3) / 2# Zc = 0 Dim Xv, Yv, Zv As Double Xv = L / 2# Yv = L * Sqrt(3) / 6 Zv = L * Sqrt(6) / 3# Dim i As Integer 'point1 walks along AV Dim Dx1, Dy1, Dz1, Dx2, Dy2, Dz2 As Double Dx1 = (Xv - Xa) / segs Dy1 = (Yv - Ya) / segs Dz1 = (Zv - Za) / segs 'point2 walks along BC Dx2 = (Xc - Xb) / segs Dy2 = (Yc - Yb) / segs Dz2 = (Zc - Zb) / segs 'point3 walks along BV Dim Dx3, Dy3, Dz3, Dx4, Dy4, Dz4 As Double Dx3 = (Xv - Xb) / segs Dy3 = (Yv - Yb) / segs Dz3 = (Zv - Zb) / segs 'point4 walks along CA Dx4 = (Xa - Xc) / segs Dy4 = (Ya - Yc) / segs Dz4 = (Za - Zc) / segs 'point5 walks along CV Dim Dx5, Dy5, Dz5, Dx6, Dy6, Dz6 As Double Dx5 = (Xv - Xc) / segs Dy5 = (Yv - Yc) / segs Dz5 = (Zv - Zc) / segs 'point6 walks along AB Dx6 = (Xb - Xa) / segs Dy6 = (Yb - Ya) / segs Dz6 = (Zb - Za) / segs 'draw those lines: For i = 0 To segs 'lines between point1 and point2: Set aLine = Draw(Xa + Dx1 * i, Ya + Dy1 * i, Za + Dz1 * i, Xb + Dx2 * i, Yb + Dy2 * i, Zb + Dz2 * i) 'the lines between point3 and point4: Set aLine = Draw(Xb + Dx3 * i, Yb + Dy3 * i, Zb + Dz3 * i, Xc + Dx4 * i, Yc + Dy4 * i, Zc + Dz4 * i) 'the segments between point5 and point6 Set aLine = Draw(Xc + Dx5 * i, Yc + Dy5 * i, Zc + Dz5 * i, Xa + Dx6 * i, Ya + Dy6 * i, Za + Dz6 * i) Next i ' Close sketch swModel.SketchManager.InsertSketch True 'swModel.ClearSelection2 True End Sub Function Draw(X1, Y1, Z1, X2, Y2, Z2 As Double) As SldWorks.SketchSegment Set Draw = swModel.SketchManager.CreateLine(X1, Y1, Z1, X2, Y2, Z2) End Function
  3. Hi, Here’s a preview of what the new Offsetea will look like. Sorry for the delay — I’ve had other things to take care of. Still, I believe the wait will be worth it. Each improvement leads to another... but I think I'm going to stop here I still need to fine-tune a few things, but the final result will be very close to what you see in the clip: -Projection of straight line segments -3 projection modes for arc segments (one of them is the same as the one Evgeny proposed in his code) + 1 custom mode that I still have to write. Switching between modes is as simple as pressing keys 1, 2, 3, or 4 -Snapping to adjust position with the cursor -Real-time "texting" using grread in all cases -Voice assistance to provide useful info I'll try to finish it this week, but I can’t promise anything — I’ve got quite a bit of work. Still, I hope that with this small preview I’ve earned a bit of your patience Offsetea Reloaded.mp4
  4. Going to have to click a little then. or use fence like BIGAL shows.
  5. Yesterday
  6. Interesting Bricscad using "Fence" option. No code needed.
  7. BIGAL

    An Open-source TIN entity

    Looks good, next option would be "Add breaklines" to make the TIN take into account edges.
  8. Consider this link with multiple solutions https://www.theswamp.org/index.php?topic=53993.0
  9. SLW210

    Ladder orientation

    What version of AutoCAD Electrical? Unless it's changed, you go to Drawing Properties under the Drawing Format tab and select "Vertical" under Ladder Defaults. Maybe this will help... AutoCAD Electrical 2025 Help | To Work With Ladders | Autodesk
  10. Sorry BigAl, I was forgetting BricsCAD - I've never used it so no sure what it has and doesn't
  11. Thanks, that works better
  12. I spoke too fast
  13. Mountain_XD

    How to Extend Lines to shape 2D Polyline

    I agree with you but what if there are a lot of polylines and lines?
  14. check your 'projmode if 'extend too' entity is on a different 'Z' I like [2]
  15. You don't need a lisp for that. just the extend command.
  16. Danielm103

    An Open-source TIN entity

    Oh, explode will create polylines and faces
  17. Danielm103

    An Open-source TIN entity

    There’s a sample point drawing on github TIN, Major and Minor and have transparency, but they are currently hard coded to TIN 50%, Minor 50%, Major %100
  18. Just having some fun… A custom object that does triangulation and contours. Its very fast (I think) I’ve only tested on one drawing; Binaries are in the release folder here (AutoCAD 2025-2026, ZwCAD 2025-2026, GstarCAD 2026) https://github.com/CEXT-Dan/ArxTin Command: TINNER Select objects: Specify opposite corner: 41769 found Select objects: Enter a major contour interval: 100 Enter a minor contour interval: 10 CArxTinUIApp::CArxTinUIApp_tinner Done , 0.000235 seconds Command: LIST Select objects: CEXTDBTIN Layer: "tin" Space: Model space Color: BYLAYER Linetype: "Continuous" Handle = cb4cf Number of points: 41769 Number of triangles: 82720 Minimum elevation: 5503.992569 Maximum elevation: 7060.996567 2D area: 37224000.000000 3D area: 47335595.172935
  19. Please help me Extend Lines to Polyline. Thanks so much ! Extend Lines to Polyline.dwg
  20. @Steven P did trusted paths above including check if running Bricscad which does not have trusted paths. Another way to push lisps to a pc is you can via lisp unzip a ZIP file to a location, advantage is only one file rather than copying a whole directory. I use this as part of install lisps. Its super fast. Just need a "Filename" (startapp (strcat "powershell -command Expand-Archive -Path '" filename "' -DestinationPath 'C:/xxx-CAD-TOOLS' -FORCE")) (alert "programs unzipped to C:/xxx-CAD-TOOLS")
  21. Last week
  22. BIGAL

    ATTDEF COUNT...help

    @GLAVCVS & @leonucadomi have a look at this it,s not code solution but rather a number of defuns to talk to Excel, read and write plus more. I keep adding functions. Alan Excel library.lsp
  23. leonucadomi

    ATTDEF COUNT...help

    It can also be a csv file Here I have an example code that, while calculating, generates a file like the one I told you about. (setq fn (getfiled "Fichero de punto a exportar" "" "csv" 1)) (setq Archivo (open fn "w")) (setq var0 "Puntos") (setq var1 "Angulos") (setq var2 "Distancias") (princ (strcat var0 "," var1 "," var2) Archivo) (princ "\n" Archivo) (setq n 0)
  24. leonucadomi

    ATTDEF COUNT...help

    thank you master
  25. GLAVCVS

    ATTDEF COUNT...help

    Excel and I barely know each other. I don't feel as prepared as some to talk about him
  26. GLAVCVS

    ATTDEF COUNT...help

    ;BACALADODEBILBADOO.noes (defun nqf (tuSS / i lista tipObj cad) (princ "\nNumero que falta") (terpri) (setq cant (sslength tuSS)) (princ "\nCantidad de textos seleccionados = ") (princ cant) (princ "\nLista de numeros faltantes") ;Pasar del SS a una lista de valores (setq i 0) (repeat (sslength tuSS) (setq tipObj (cdr (assoc 0 (setq le (entget (ssname tuSS i))))) num (atoi (cdr (assoc (if (= tipObj "TEXT") 1 2) le))) i (1+ i) lista (if (setq l (assoc num lista)) (subst (list num (1+ (cadr l))) l lista) (append lista (list (list num 1))) ) ) ) ;Imprimir los valores que no aparezcan (terpri) (setq i 1) (princ (strcat "\nLista de numeros existentes\n" (while lista (if (setq v (assoc i lista)) (setq cad (if (= (cadr v) 1) (if cad (strcat cad ", " (itoa (car v))) (itoa (car v)) ) (if cad (strcat cad ", " (itoa (car v)) "(" (itoa (cadr v)) ")") (strcat (itoa (car v)) "(" (itoa (cadr v)) ")") ) ) lista (vl-remove v lista) ) (princ (strcat "\nFalta el # " (itoa i))) ) (setq i (1+ i)) cad ) ) ) (princ) ) (defun c:nqf nil (nqf (ssget '((0 . "TEXT,ATTDEF")))))
  27. leonucadomi

    ATTDEF COUNT...help

    It's excellent, thank you I just think there is a mistake When the first number has more than one repetition, it is not counted. Could it be possible to export a file xls with two columns of values, its tag and its quantity?
  28. Since you're not using the return for vl-directory-files (just checking if it exists), findfile will be much faster: (defun _vl-directory-files (path /) (vl-directory-files path "*.*") ) (defun _findfile (path /) (findfile path) ) Quick benchmark: _VL-DIRECTORY-FILES Elapsed: 1391 Average: 0.1391 _FINDFILE Elapsed: 484 Average: 0.0484 In any event, here's a slightly simplified mod: (defun c:SetTrustedPaths (/ ) (foreach path (list "C:\\Users\\A Folder\\LISPs\\..." ) (_SetTrustedPaths path) ) (princ) ) (defun _SetTrustedPaths (path / trustedpaths) ;; folder check (if (not (findfile path)) (vl-mkdir path)) ;; trusted path check (if (vl-string-search (strcase path) (strcase (setq trustedpaths (getvar 'trustedpaths))) ) trustedpaths (setvar 'trustedpaths (strcat (if (= 59 (last (vl-string->list trustedpaths))) trustedpaths (strcat trustedpaths ";") ) path ) ) ) ) Cheers
  1. Load more activity
×
×
  • Create New...