CadFrank Posted March 9, 2016 Posted March 9, 2016 Hi, I'd like to know if we can make our own defpoint Layer using autolisp. I'd like to make sure they can't turn on the print function. Thank! Quote
ReMark Posted March 9, 2016 Posted March 9, 2016 (edited) Yes, you can. But how does creating a Defpoints layer stop a user from printing if he/she really wants to? They could always move everything over to layer "0" and then print. And as far as I know users cannot delete layer "0". Something along the lines of this (per alanjt)... (defun c:LM () (command "-layer" "make" "defpoints" "" ) (princ)) Edited March 9, 2016 by ReMark Quote
CadFrank Posted March 9, 2016 Author Posted March 9, 2016 Well you can't change the plot option on the defpoint. So how could they change back the value? Quote
ReMark Posted March 9, 2016 Posted March 9, 2016 (edited) There is no method to change the plot option of the Defpoints layer that I am aware of. A user could simply invoke the Change to Current Layer command (Format > Layer Tools) and take all objects on the Defpoints layer and put them on layer "0" at which point they could then print the drawing. There are probably a couple more ways to achieve the same result I haven't even thought of. OK...another way to do it. Use the Format > Layer Tools > Copy Objects to New Layer command. Copy the objects to layer "0", print the drawing then erase all the objects once the operation is completed. And one more that is even better. Use the Format > Layer Tools > Layer Merge command. Users will need at least one object on layer "0". Invoke the command, follow the command prompts and note that once the objects on the Defpoints layer have been merged with the objects on layer "0" the Defpoints layer is deleted! Oh what a great way to have some fun with a drawing. Edited March 9, 2016 by ReMark Quote
ksperopoulos Posted March 9, 2016 Posted March 9, 2016 Unless I misunderstand what your OP says, if you don't want them to be able to turn the plottable option on, then just use the "Defpoints" layer. It will never be able to turn on. Otherwise, they will always have the ability to turn the plottable option on whatever layers you create on or off. Quote
ReMark Posted March 9, 2016 Posted March 9, 2016 ksperopoulos: And just how would that prevent a user from printing the drawing? Could you please explain? Thanks. Quote
ksperopoulos Posted March 9, 2016 Posted March 9, 2016 Hi, I'd like to know if we can make our own defpoint Layer using autolisp. You can create a layer using AutoLISP, but it cannot be named "Defpoints" because you can't create a layer that already exists. Also, the "Defpoints" layer can't be deleted. I'd like to make sure they can't turn on the print function. If he wants to create a new layer that won't plot, then he can control that setting using AutoLISP by turning off the plot option for that layer when its created. But this will not disable any of his users from going into the layer manager after it is created and manually turning the plot option on for that layer. If he wants to create a new layer that has the plot options set to off and also grayed out (similar to the "Defpoints" layer), that is not possible. Quote
ReMark Posted March 9, 2016 Posted March 9, 2016 "You can create a layer using AutoLISP, but it cannot be named "Defpoints" because you can't create a layer that already exists." If you start a new drawing and run the lisp routine I posted you can indeed create a layer called Defpoints with the plot option grayed out. Did you assume I'd post a lisp without first testing it? Quote
ksperopoulos Posted March 9, 2016 Posted March 9, 2016 This is what I get when trying to delete the "Defpoints" layer. Therefore, it can't be deleted from the drawing file. That means it already exists. Your lisp works, but it only sets the "Defpoints" layer as current since it already resides in the file. Anyway, I believe the OP wants to create a new layer that his users cannot change the plot option. Your lisp creates the "Defpoints" layer that is already available to him. Quote
ReMark Posted March 9, 2016 Posted March 9, 2016 I suppose it depends on whether or not your template file has a Defpoints in it. If it doesn't then the lisp routine will work. Tested three times and successful on each try. And the Defpoints layer can be deleted from a drawing under certain circumstances. Everything is not hard and fast when it comes to AutoCAD. Quote
ksperopoulos Posted March 9, 2016 Posted March 9, 2016 And the Defpoints layer can be deleted from a drawing under certain circumstances. Everything is not hard and fast when it comes to AutoCAD. I apologize and stand corrected. I just purged everything out of my template file and the "Defpoints" layer did get removed. Nonetheless, your lisp routine for creating the "Defpoints" layer is really just reinserting the layer back into the file. If you were to change the name in your lisp to something else, the plot option would be turned on and not grayed out. Quote
ReMark Posted March 9, 2016 Posted March 9, 2016 I've mentioned more than once over the years here at CADTutor that I'm technically blind in one eye (1000/20 vision) but not so blind I can't read this... Quote
ReMark Posted March 9, 2016 Posted March 9, 2016 I apologize and stand corrected. I just purged everything out of my template file and the "Defpoints" layer did get removed. Nonetheless, your lisp routine for creating the "Defpoints" layer is really just reinserting the layer back into the file. If you were to change the name in your lisp to something else, the plot option would be turned on and not grayed out. It matters not a wit if the Defpoints layer remains in the drawing or even if there was a way to create a new layer, similar to Defpoints, that had the print option permanently disabled. Since layer "0" cannot be deleted then anyone who opens the drawing and wants to print it can do so given the THREE methods previously mentioned. Quote
ksperopoulos Posted March 9, 2016 Posted March 9, 2016 I agree with what you are saying. Things on the "Defpoints" layer can be moved to another layer and the "Defpoints" layer can then be deleted from the drawing file. I already said that I was wrong about being able to delete this layer. But would you please read the original post again? He does not want to move things that are on the "Defpoints" layer to another layer. He wants to create his own version of a "Defpoints" layer in which the plot option cannot be modified. Your three methods do not help him out with this. Quote
ReMark Posted March 9, 2016 Posted March 9, 2016 Maybe you should reread the post. He basically wants to stop another CAD user from plotting the drawing using a layer (call it anything you like) with the option to print completely disabled just as it is in the Defpoints layer. Ain't gonna happen amigo. "Hi, I'd like to know if we can make our own defpoint Layer using autolisp." Answer: YES, you can make a new layer called Defpoint(s). "I'd like to make sure they can't turn on the print function." Answer: And what good would this do if there are ways to circumvent the disabled print function? Quote
ksperopoulos Posted March 9, 2016 Posted March 9, 2016 Isn't that what I said in my post here? (with the exception of the "Defpoints" layer able to be deleted) Quote
ReMark Posted March 9, 2016 Posted March 9, 2016 Bottom line: I think the OP just wants to keep someone form being able to print his drawing. The "Defpoints-like-layer" idea is a bust. Quote
CadFrank Posted March 11, 2016 Author Posted March 11, 2016 Waaaa!!! I've lifted a nice conversation Well people where I work don't know much about AutoCad. So they wouldn't know how to make defpoint printable. Regards for your wisdom ill see what I can make with it. Cheers beers! Quote
ReMark Posted March 11, 2016 Posted March 11, 2016 CadFrank: The "real" Defpoints layer that is created when the first dimensions are placed in a drawing is set to be non-printable and there is no way to reverse that setting. That is why it is grayed out rather than having a red diagonal line through it in the Layer Properties Manager. That symbol on any other layer can be reversed quite easily just by clicking on it. Quote
rkmcswain Posted March 11, 2016 Posted March 11, 2016 The "real" Defpoints layer.... Is there a way to make a "fake" defpoints layer? I don't believe it matters how the layer is created (manually, with lisp, .NET, etc.), it seems to be the name that makes it obtain the special properties attributed to the Defpoints layer in general. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.