Re: Assigning Layer +Line/Curve Style with .net API
Blackbox, you are the man. Tested it out and seems to work just fine. Looks like I can just copy and paste the command function as much as I want and we're good to go?
I'm in training today and tomorrow so I won't be able to get too into it and make sure everything works without a hitch, but I'm thinking you nailed it.
Thanks!
Edit: Ok so I tested it out on a blank drawing (our instructor is running late :D), seems to work on parcel lines and polylines. Went into an actual plat drawing and it doesn't seem to produce the dimensions. Playing around with it some more, I don't think I have the relevant layers frozen or anything.
Seems the second command works differently than the first (I see it's addsegmentlabelS instead of addsegmentlabel), never played around with the plural version so I'll have to dink around with it at some point. I think, at the very least, that the first command is pretty much exactly what we need. I'll report back later.
Thanks again.
Re: Assigning Layer +Line/Curve Style with .net API
Quote:
Originally Posted by
Varlth
Blackbox, you are the man. Tested it out and seems to work just fine. Looks like I can just copy and paste the command function as much as I want and we're good to go?
I'm in training today and tomorrow so I won't be able to get too into it and make sure everything works without a hitch, but I'm thinking you nailed it.
Thanks!
That is kind of you to say, Varlth; I'm happy to help. :beer:
I coded it to be dependent on a sub-function with parameters, so you could do just that - copy + customize the sample calling routine to build a small contingent of 'quick Segment Label commands' as needed (i.e., Sanitary, Storm, Water, Base Lines, Plats, etc.), and the dependent sub-function does all of the work for you.
Just be mindful that the sub-function must be loaded in order for the calling functions to work - I'd suggest placing your various custom 'quick' commands and the dependent sub-function in a single LISP file, and use an AUTOLOAD Statement to demand-load the routine.
Good luck on your training, and let me know how this works out for you.
Cheers
Re: Assigning Layer +Line/Curve Style with .net API
Yeah I see how the two correlate, I glanced over the dependent function and didn't see anything specific that I'd need to edit/watch out for so that's why I was looking for confirmation on just copying the command. I have a dubbed "master" routine that I put anything that doesn't affect drawing settings on load that anyone in the company can safely load by default and I was just planning to throw all of it into that file.
I've never had to use the addsegmentlabels function though, which I see you wrote for as well. It seems to be set up to dimension an entire lot, but it's dependent on the lot's current layer instead of setting the layer you want. Interesting though, and I'll have to play around with it to see if I like it.
Now I have to go through and make sure all my line styles are set properly in the template (and I believe one or two isn't...). I'll probably report back Thursday or Friday sometime mid day CST time.
Re: Assigning Layer +Line/Curve Style with .net API
Just wanted to report back in like I said I would. Looks like it's working just as advertised now. Got the template sorted out, and going forward on future drawings this will be easy to use. I use 2016 and it works fine for me so I assume other versions shouldn't have any issue.
Thanks again Blackbox, and thanks Opie for pointing him in the right direction!
Re: Assigning Layer +Line/Curve Style with .net API
Hm...
Some mediocre news.
The routine works fine for the most part, but if it's used on a parcel line it grabs the parcel's layer instead of setting the layer defined in the routine. I noticed this on the segmentS command when I played with it, but now see it's happening whenever you use the command on a parcel segment.
Any ideas on this? Normally I would think to add some sort of set layer function before the command is run, but I have the layer set to SP-PL anyways and it uses the O-PRCL layer regardless because that's the layer the lot line is on.
Thanks
edit: Also, I don't know if this matters much or not, but since this is being solved by lisp we could probably move this to the appropriate forum.
Re: Assigning Layer +Line/Curve Style with .net API
Quote:
Originally Posted by
Varlth
Hm...
Some mediocre news.
The routine works fine for the most part, but if it's used on a parcel line it grabs the parcel's layer instead of setting the layer defined in the routine. I noticed this on the segmentS command when I played with it, but now see it's happening whenever you use the command on a parcel segment.
Any ideas on this? Normally I would think to add some sort of set layer function before the command is run, but I have the layer set to SP-PL anyways and it uses the O-PRCL layer regardless because that's the layer the lot line is on.
Thanks
edit: Also, I don't know if this matters much or not, but since this is being solved by lisp we could probably move this to the appropriate forum.
Parcel labels are also a property of the ObjectLayerSettings property.
Re: Assigning Layer +Line/Curve Style with .net API
Hi Opie,
Sorry I took awhile to get back. Had to sideline working with this cause of workload.
I took a look at Blackbox's code, but I'm honestly lost at what to do with the ObjectLayerSettings property. I can see it being used in his code, but I have no idea where to go beyond that unfortunately.
Re: Assigning Layer +Line/Curve Style with .net API
I had not actually looked for that specific property when commenting and, unfortunately, have found that specific property is not exposed (at least in 2013) to LISP. Sorry.
Re: Assigning Layer +Line/Curve Style with .net API
I'll check newer versions here to see if they've exposed the subsequent property being requested.
If not, the two options are to either port the earlier code to .NET in entirety, or to write a custom LispFunction Method thereby 'exposing' same.
For reference:
http://docs.autodesk.com/CIV3D/2016/...fdba465699.htm
Re: Assigning Layer +Line/Curve Style with .net API
2016 does not show it either. :(
BTW, BB, the code you posted above for version checking of C3D could be automated to detect the active version of Civil 3D.