Indeed (entmake) does not work entirely with fields.
And you're right about dictionaries, we can do them with entmake, but it's complicated.
With (vla-addMtext), it's much simpler, it takes care of the dictionary itself.
((lambda ( / AcDoc Space)
(setq
AcDoc (vla-get-ActiveDocument (vlax-get-acad-object))
Space
(if (= 1 (getvar "CVPORT"))
(vla-get-PaperSpace AcDoc)
(vla-get-ModelSpace AcDoc)
)
)
(initget 1)
(vla-update
(vla-addMtext Space
(vlax-3d-point (getpoint "\nInsertion point; "))
0.0
"%<\\AcVar Filename \\f \"%tc4%fn7\">% %<\\AcVar SaveDate \\f \"MMMM d, yyyy - hh:mm tt\">% %<\\AcVar LastSavedBy \\f \"%tc4\">%"
)
)
))
Autodesk Education & Student Access | Autodesk
You can pay by the month and first 30 days is a free trial. There are cheaper alternatives to AutoCAD, like BricsCAD.
I think its making contour labels this is a copy of the method inside CIV3D. Did something 30 years ago the fence works out the intersection with the contour and gets Z. No idea where to find it. If we go back even further in time a non ACAD civil software just auto labelled the contour RL based on a spacing factor. Way simpler than using fence.
I added drawing file path, save date and saved by to custom properties in my template files placing them in all our title blocks so they're displayed on every layout on all our drawings automatically.
I added drop-downs in Properties tab for setting custom properties like picking the engineer for the signature block or entering the field book number for the survey notes.
The issue maybe is that you have 2 variables Savedate and Lastsavedby when you close the dwg these will probably disappear, so no update,
I have started using this for saving info in a dwg, rather than variables 1-5, Userr1, Useri1, Users1.
(vlax-ldata-put "StevenP" "SAVEDATE" yourdate )
(setq savedate (vlax-ldata-get "StevenP" "SAVEDATE"))
I can't quite see what it is doing exactly from the video, however it looks like a ssget function with a selection mode, fence, crossing polygon or window ( https://lee-mac.com/ssget.html ).
Do you select the points as you move the mouse over the text rather then using a straight line - sort of wave the mouse around the screen and select it all that way? That could be interesting but complicated - using gread (which the documentation says is an advanced method and rarely needed). Might be worth reading about and can be interesting when you work it out:
gread to get the mouse location, using its position to select entities as it passes over them. On selection 'redraw' to highlight the entity and add to a selection set, to do that on the fly and highlight the entities.
You could just use gread to create a polygon fence / crossing polygon, hit enter and then use ssget to select all the text within that area which is a bit simpler.
If someone has the time that look like an interesting problem
So 3 options:
ssget and fence based on the start and end points of the mouse based on clicks
ssget and fence based on the path the mouse takes using gread to capture the points it moves along to create the fence
'on the fly' using gread and points underneath as you go (I'd have to think about the method for that one but sounds most fun (?)
Just a question why are they wrong ? Going back a step how is leader made & how is text made. Does not make much sense that its being done incorrectly. Sounds like its sloppy drafting.