Recent Posts

Pages: [1] 2 3 ... 10
1
CAD General / Blocks Pallette does not apear blocks thumbnail
« Last post by HasanCAD on Today at 05:40:54 AM »
As image attached
2
AutoLISP (Vanilla / Visual) / Re: vl-sort working in ACAD but not in BricCAD
« Last post by hmspe on September 24, 2023, 04:07:28 PM »
Most likely because your test conditions make no sense.  Sorts are generally largest to smallest or smallest to largest.  You are trying to sort equal to not equal with vl-sort.  You are also first sorting the first elements of a pair of lists using SSWNAN, then comparing the first element of the result against the first element of the first pair. 

What exactly are you trying to do?  You were asked for the expected output but you did not respond.

If you are trying to sort blklist by the first elements but with the numbers normalized i would do something like this:

Code - Auto/Visual Lisp: [Select]
  1. (defun c:test( / blklist)
  2.  
  3.   (defun SortAI (lst); = Sort Alphabetically, and within that by Integer value [of first element]  by Kent Cooper, AIA
  4.     (vl-sort
  5.       (vl-sort lst '(lambda (a b) (< (atoi (substr (car a) 2)) (atoi (substr (car b) 2)))))
  6.       '(lambda (c d) (< (substr (car c) 1 1) (substr (car d) 1 1)))
  7.     )
  8.   )
  9.  
  10.  
  11.   (setq blklist (list (list "A20" "B2") (list "A13" "B1") (list "A9" "B1") (list "A16" "B4")))
  12.   (sortAI blklist)
  13. )
  14.  
3
AutoLISP (Vanilla / Visual) / Re: Placing objects on new layers
« Last post by HasanCAD on September 24, 2023, 09:09:32 AM »
I want to move objects to new layer with new properties. I believe LEE solution is good.
Thanks lee
Thanks BEGAL
I believe "RENAME" does not change layer properties.
4
AutoLISP (Vanilla / Visual) / Re: Placing objects on new layers
« Last post by HasanCAD on September 24, 2023, 09:06:52 AM »
I want to move objects to new layer with new properties. I believe LEE solution is good.
Thanks lee
Thanks BEGAL
5
AutoLISP (Vanilla / Visual) / Re: vl-sort working in ACAD but not in BricCAD
« Last post by mailmaverick on September 24, 2023, 01:24:00 AM »
But why doesn't BricsCAD work with SortStringWithNumberAsNumber inside vl-sort, whereas AutoCAD works fine.
6
.NET / Re: AcDbDimAssoc
« Last post by It's Alive! on September 23, 2023, 11:43:13 PM »
It’s a little weird from a memory perspective, so I can see a reason why Autodesk may have not implemented this
AcDbPointRef cannot be garbage collected after it’s added AcDbDimAssoc, otherwise it will crash.

Oda uses reference counting, I have a flag in Python’s analog to DisposableWrapper to handoff ownership in setPointRef

Code - C++: [Select]
  1. void PyDbDimAssoc::setPointRef(int ptType, PyDbPointRef& ptRef)
  2. {
  3.     PyThrowBadEs(impObj()->setPointRef(ptType, ptRef.impObj()));
  4.     ptRef.forceKeepAlive(true); //never gets here on exception
  5. }
  6.  
  7. PyDbPointRef PyDbDimAssoc::pointRef(int ptType) const
  8. {
  9.     //uses a const CTOR, autoDelete = false
  10.     //const AcDbPointRef* pointRef(int ptType) const;
  11.     return PyDbPointRef(impObj()->pointRef(ptType));
  12. }
  13.  

Hopefully this won’t come back to bite me.
A, I’ll add test coverage,
B, I’ve made DisposableWrapper flags public to python so users can intercept before garbage collection

7
.NET / Re: AcDbDimAssoc
« Last post by It's Alive! on September 23, 2023, 11:15:05 PM »
well that's certainly less verbose than
https://www.theswamp.org/index.php?topic=58593
8
.NET / Re: AcDbDimAssoc
« Last post by kdub_nz on September 23, 2023, 10:38:22 PM »
The associated dims issue is weird in regard to documentstion.

https://help.autodesk.com/view/OARX/2024/ENU/?guid=GUID-27B4098E-AA85-4F02-8C60-E87558E67D4B

Quote
Understand Associative Dimensions (.NET)
Associative dimensions automatically adjust their locations, orientations, and measurement values when the geometric objects associated with them are modified. The DIMASSOC system variable controls associative dimensioning. Set DIMASSOC to 2 to turn on associative dimensioning.

. . . and that's it.

The way I read that is : just set DIMASSOC to 2 and magic happens  ??


I'll try it one day , perhaps.
9
.NET / Re: AcDbDimAssoc
« Last post by It's Alive! on September 23, 2023, 09:39:48 PM »
Perhaps a post in Feature Requests on the Venn Alpha forum would help others Daniel.
. . . at least make the issue known.

There are couple of requests that deserve an upvote there.

Hi Kerry,

Good idea, though, I have not investigated if .NET provides another way of associating dimensions to geometry
There’s a bunch of other *Assoc* classes, some of which my not be in ARX

I’ll keep a list of classes that may be missing as I work though creating wrappers


Code: [Select]
AcDbPointRef
AcDbOsnapPointRef
AcDbDimAssoc

AcDbDimAssoc::PointType or  DimAssocPointType (BricsCAD)
AcDbDimAssoc::AssocFlags or AssocFlags(BricsCAD)
AcDbDimAssoc::RotatedDimType or RotatedDimType(BricsCAD)

10
AutoLISP (Vanilla / Visual) / Re: Offset automatic - Help please
« Last post by fabiocosta81 on September 23, 2023, 09:11:23 PM »
(DEFUN c:man ()

     (SETQ osnape (GETVAR "osmode"))
     (SETVAR "osmode" 0)
 
     (SETQ objeto (CAR (ENTSEL "\nSelecione o objeto: ")))

     (setq p1 (getpoint "\n-->Clique no lado do Afastamento: "))
     (command "offset" 0.08 objeto p1 "")

     (SETQ dadoslinha (entget (ENTLAST)))
     (SETQ novalinha (SUBST (CONS 8 "MANTA") (ASSOC 8 dadoslinha) dadoslinha))
     (SETQ novalinha (SUBST (CONS 43 0.04)(ASSOC 43 novalinha)novalinha))
     (ENTMOD novalinha)
     (command "offset" 0.08 (entlast) p1 "")

     (SETVAR "osmode" 1)
     (setq p2 (getpoint "\n-->Clique vértice da sobreposição Horizoltal: "))
     (setq p3 (getpoint "\n-->Clique vértice da sobreposição Vertical: "))
     (setq p4 (polar p3 (* 90 (/ pi 180)) 1))
     (setq p5 (list (+ (car p4)0.1)(+ (cadr p4)0.05)(caddr p4)))
     (setq p6 (list (- (car p4)0.02)(+ (cadr p4)0.05)(caddr p4)))

     (SETVAR "osmode" 0)
     (command "xline" "v" (polar p2 0 1)"")
     (command "xline" "h" p4 "")
     (command "xline" "h" (polar p3 (* 90 (/ pi 180)) 1.1)"")
     (command "trim" "f" "" p5 p6 "")
     (SETVAR "osmode" osnape)
)
Pages: [1] 2 3 ... 10